+ 3
Why am i unable to use void main() in c++ ?
The error for using void main is telling that main must return int value can anybody explain what it means ?
1 Answer
+ 8
You must return an int value in main() function.
It tells the system if the program has successfully run or not.
So, if you opt to use void, then it means you are not going to return anything. But the system will still seek for an int value. That is why it raises an error.
Therefore, you cannot use void as the data type for the main() function.