+ 1
what is theDifference between void main() and int main() ?
By using both the statement the program works. The difference between them are that we have to return a value in int main() . But what does they impact on the program ?
3 Réponses
+ 5
There is no impact on the program itself. But the operating system, that calls your application, might want to know if your application ran correct or if there was an error. So to signal this, you return a error / status code which can then be evaluated by the OS/caller of your program.
+ 1
how not to program in c++
by Steve Qualline
i read on this book that the standard way is int main and the other one is wrong.
+ 1
void main() return nothing to OS and Int main() returns int value to OS