• Cursussen
  • Code Compiler
  • Discussiëren
  • Prijzen
  • Teams
Menu
0

can't we use void main instead of int main in programs

#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 0; }

c++
10th Oct 2017, 8:51 AM
arshpreet
arshpreet - avatar
1 Antwoord
+ 15
In C++ NO, but C YES/NO (Don't take my word for it and study the following links)! [https://stackoverflow.com/questions/449851/why-do-we-need-to-use-int-main-and-not-void-main-in-c] [https://stackoverflow.com/questions/204476/what-should-main-return-in-c-and-c]
10th Oct 2017, 9:06 AM
Babak
Babak - avatar

Heb je vaak vragen zoals deze?

Leer efficiënter, gratis:

  • Inleiding tot Python

    7,1 miljoen leerlingen

  • Inleiding tot Java

    4,7 miljoen leerlingen

  • Inleiding tot C

    1,5 miljoen leerlingen

  • Inleiding tot HTML

    7,5 miljoen leerlingen

Bekijk alle cursussen
Populair vandaag
Guys I don't know anything about cooding who can help me pls
1 Votes
Decorators in python.
2 Votes
Coding for Cybersecurity
1 Votes
Need help
1 Votes
What do you think of this code and what are your suggestions for developing and modifying it?, How can I develop myself more?
1 Votes
Salut tout le monde
2 Votes
Pointers in c#
1 Votes
Please click me
0 Votes
Can sololearn have multiple inpus&outputs?
3 Votes
How to Get Better at Solving Programming Problems
0 Votes