3 ms·
For a freestanding implementation, the program entry point is entirely implementation-defined. It may or may not be called "main". In that kind of environment,
by _kst_ 6y ago
For a freestanding implementation, the program entry point is entirely implementation-defined. It may or may not be called "main". In that kind of environment, "void main()" (or, better, "void main(void)") might be correct. You need to read the implementation's documentation.
For hosted implementations, "void main()" might be valid, but "int main(void)" is always valid.
A tutorial should not suggest "void main()" without mentioning any of this.
Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf sections 5.1.2.1 (freestanding environments) and 5.1.2.2.1 (hosted environments).