Yes, your example works fine. However, when adding a pointer (type doesn't seem to matter) as a second argument it doesn't work anymore (shows same behavior as in my case):
Code:
int test (char* s, int *i);
int test (int n, int *i);
void main () {
int num = 5;
char* str = "4";
printf("%i", test(num, NULL)); //return 5 (this will crash)
printf("%i", test(str, NULL)); //return 4
}
int test(char* s, int *i) {
return ((int)str_to_num(s));
}
int test(int n, int *i) {
return n;
}
This code will crash now because the first prototype function is called in both cases.