void main()

What is void main(), and why wont Dev-C++ allow it?

main must return an int value << says the error message
main() is your main function, which will be run when the program is executed.

Apparently Dev-C++ requires an integral return, so change that line to: int main()
void main(); isn't recognised as part of the C++ standard. int main(); is.

And it's MingW/GCC that is throwing the error, not Dev-C++. Dev-C++ is not a compiler.
Executables would return a value after each run. I guess that's what return value of main is used for.
The return-value normally says or the program is executed correctly. 0 means it is, other values means that someting has gone wrong
Topic archived. No new replies allowed.