I am fairly new to C++ but i would like to know the difference between Int Main and Void Main. I know those are functions but whats the difference
4 Replies - 1184 Views - Last Post: 09 January 2013 - 09:07 AM
Replies To: Whats the difference between int main and void main?
Re: Whats the difference between int main and void main?
Posted 09 January 2013 - 09:04 AM
int main will return an integer, void main will not. You should use the int version, and return 0 when the program executes successfully. That will tell the system as much, and it'll interpret any other value (like 1) as if an error has occurred during the program execution.
Page 1 of 1