0
Can't we use 'void main()' as the main function as we do in c language?
I just ran a Hello world program inside the void main() function. But it gave me an error saying void must return 'int'
1 Resposta
+ 6
No, void main is an incorrect syntax, thus, returns an error. void main, was never C++.
The int is necessary to return the exit code to the operating system for successful termination.
https://www.sololearn.com/discuss/784887/?ref=app
https://www.sololearn.com/discuss/791548/?ref=app