Tuesday, March 27, 2012

Borland C++ 5.5 - Compilation warning - Call to function with no prototype in function


I have created following simple C program and compiled with Borland C++ compiler.


#include <stdio.h>
void Printme(){
printf("Hello World\n");
}
void main()
{
Printme();
}

Compiler compiled but returns warning

"Call to function 'Printme' with no prototype in function main"


When i search in internet, I coudnt get any useful information.

After long struggle, i found that the source code should be


#include <stdio.h>
void Printme(void){
printf("Hello World\n");
}
void main()
{
Printme();
}


I hope this blog could help some of the C programmers.  

No comments:

Post a Comment