Mismatch function in c/c++


char string[]=”hello world”;
void display(char *string)
Tutorial answer:Compiler Error; Type mismatch in redeclaration of function display.
Debugger solution:The compiler doesn’t know anything about the function display. it assumes the arguments and return types to be integers,(default type0.when it sees the actual function display, the arguments and type contradicts with what it has assumed previously .hence a compile time error occurs.

No comments:
Write comments