Hello there,
every time i compile and link my programs i get the following warning message :
warning (line#): return type of 'main' is not 'int'.
I am using the DJGPP compiler, could that be the reason?
Thank you for your attention.
Printable View
Hello there,
every time i compile and link my programs i get the following warning message :
warning (line#): return type of 'main' is not 'int'.
I am using the DJGPP compiler, could that be the reason?
Thank you for your attention.
Your main function should always return a type int
int main()
{
program
return 0; /* returns the int value */
}
You probably have used
void main (...)
The type of main should be int. See Axolotl's example.
Maybe in your main() function you've returned something that is not an integer... Post the code, so we can tell...
normally you can use void main(), but for compliance with ANSI and good programming practice, main should return int. This can inform the status of program termination to OS.
>normally you can use void main()
Only if your compiler supports such a declaration of main.
-Prelude