+ 1

Why it doesn't compile?

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

15th Jun 2017, 2:37 PM
Abhijit Verma
Abhijit Verma - avatar
2 Answers
+ 9
In C++, main must return int. int main() { return 0; }
15th Jun 2017, 2:45 PM
Hatsy Rei
Hatsy Rei - avatar
0
it is valid code. I don't know what's problem going on. one think to do #include<upstream.h> try it
15th Jun 2017, 2:46 PM
meherDev
meherDev - avatar