+ 1

Can we use void main instead of int main?

In our school we study void main instead of int main and the program is also compiled..

27th Aug 2017, 2:55 AM
Daily tech
Daily tech - avatar
6 Respostas
+ 13
void return type for main() has never been a part of standard C++, and will never be. https://www.sololearn.com/discuss/288609/?ref=app
27th Aug 2017, 3:02 AM
Hatsy Rei
Hatsy Rei - avatar
+ 5
That's for Turbo C++, extremely outdated...
27th Aug 2017, 5:12 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 2
So in which we can use void?
27th Aug 2017, 3:03 AM
Daily tech
Daily tech - avatar
+ 1
Yes ,but do not write return statement in end of main function
27th Aug 2017, 3:27 AM
subham sahu
subham sahu - avatar
+ 1
Yes, you can but do not write return statement in this case
27th Aug 2017, 5:15 AM
subham sahu
subham sahu - avatar
0
Ok ty
27th Aug 2017, 3:29 AM
Daily tech
Daily tech - avatar