When the compiler sees a new function (ex. show) about which it doesn’t know anything. It by default assumes the function to be returning int. But when compiler sees the actual definition of function (show), if mismatch occurs (might be because of other return type) error is generated.
main(){
show();
}
void show(){
printf(”I’m the greatest”);
}
The solutions are as follows:
1. declare void show() in main() .
2. define show() before main().
3. declare extern void show() before the use of show().
default function prototype
October 6th, 2006 · No Comments · C/C++
Tags:
















0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment