Hi,
I can compile and run this code (see below) which twice calls the
function f, first with too less, second with too much arguments.
But is it legal and free of memory leaks and other problems? Of course,
I presume that inside f I don't access i in case it was called via g.
int f(int i){ /* ... */ return 0; }
int main(int argc, char** argv){
int(*g)(void)=f ; /* less args than f */
int(*h)(int,int )=f; /* more args than f */
g();
h(0,1);
return 0;
}
Felix
I can compile and run this code (see below) which twice calls the
function f, first with too less, second with too much arguments.
But is it legal and free of memory leaks and other problems? Of course,
I presume that inside f I don't access i in case it was called via g.
int f(int i){ /* ... */ return 0; }
int main(int argc, char** argv){
int(*g)(void)=f ; /* less args than f */
int(*h)(int,int )=f; /* more args than f */
g();
h(0,1);
return 0;
}
Felix
Comment