Posted By: Fenriswolf
Function overloading - 08/19/08 21:12
Hello,
the problem is simple: I just can't get overloaded functions working.
The first function (which accepts an integer) is always used, even if typecasting a char as first parameter.
If I change the order of the prototypes the other function is always used instead.
Does somebody know what I'm doing wrong here?
the problem is simple: I just can't get overloaded functions working.
Code:
// Prototypes for overloaded function AVL_ELEM *avlElem_create(int i_key, void *p_data); AVL_ELEM *avlElem_create(char *c_key, void *p_data); /* * ... */ avlElem_create((int)12, data); // first function gets called avlElem_create((char*)"hello", data); // first function gets called again
The first function (which accepts an integer) is always used, even if typecasting a char as first parameter.
If I change the order of the prototypes the other function is always used instead.
Does somebody know what I'm doing wrong here?