- #1
dect117
- 25
- 1
My understanding is that if the main function's return type is an integer, i.e. it looks like this: int main () {...}, then "return 0;" must be written otherwise the function won't work. My professor said that the exception would be if you wrote "void" in the parenthesis like this: "int main (void)". However, this piece of code works just fine without "void" or "return 0;". Why?
Code:
#include <stdio.h>
int main () {
printf ("Hello!");
}