Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Point out the error in the following program (if it is compiled with Turbo C compiler). #include<stdio.h> int main() { display(); return 0; } void display() { printf("IndiaBIX.com"); } ?->(Show Answer!)
1. Point out the error in the following program (if it is compiled with Turbo C compiler). #include<stdio.h> int main() { display(); return 0; } void display() { printf("IndiaBIX.com"); }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
In this program the compiler will not know that the function display() exists. So, the compiler will generate "Type mismatch in redeclaration of function display()". To over come this error, we have to add function prototype of function display().
Another way to overcome this error is to define the function display() before the int main(); function.
#include<stdio.h>void display(); /* function prototype */int main() { display(); return0; } void display() { printf("IndiaBIX.com"); } Output: IndiaBIX.com Note: This problem will not occur in modern compilers (this problem occurs in TurboC but not in GCC).
Another way to overcome this error is to define the function display() before the int main(); function.
#include<stdio.h> void display(); /* function prototype */ int main() { display(); return 0; } void display() { printf("IndiaBIX.com"); } Output: IndiaBIX.com Note: This problem will not occur in modern compilers (this problem occurs in TurboC but not in GCC).