12 Mart 2010 Cuma

C++ da Overloading Fonksiyon Tanımlama

//www.ethemsulan.com
#include <cstdlib>
#include <iostream>
using namespace std;
inline int min(int a,int b){
       return a<b?a:b;
       }
inline long min(long a,long b){
       return a<b ? a:b;
       }
inline double min(double a,double b){
       return a<b ? a:b;
       }
int main(int argc, char *argv[])
{
    cout<<min(-10,10)<<endl;
    cout<<min(1009.1,345.5)<<endl;
    cout<<min(10L,5L)<<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}

Hiç yorum yok:

Yorum Gönder