That was already mentioned by antiRTFM
Oppsy... Didn't see that.
As for the DOS and all that stuff. I was talking more specifically written C++ code in the compiler. Although what you are saying is perfectly true.
http://www.youtube.com/user/antiRTFM
http://cpptutorials.freeforums.org/
That was already mentioned by antiRTFM
#include <iostream>
int main()
{
return 0;
}KING-T wrote:
- Code: Select all
#include <iostream>
int main()
{
return 0;
}
int main(){}
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout<<"Hi Bye";
cin.get();
}antiRTFM wrote:Yes.
Quote from the standard c++ draft (3.6.1 5):...If control reaches the end of main without
encountering a return statement, the effect is that of executing
return 0;
GrimSoul wrote:antiRTFM wrote:Yes.
Quote from the standard c++ draft (3.6.1 5):...If control reaches the end of main without
encountering a return statement, the effect is that of executing
return 0;
Not with my compiler =) if the function expects something to be returned ( not void ) you must return something. Likewise if something is returned to a function that expects nothing to be returned ( void ) i get a compiler error.
Im using dev-C++ by bloodshed , so your shortest code is non standard
int main() {}
no1important wrote:Hasn't any one got this? It compiles and runs in Dev C++.
CODE:
main(){}
#include <windows.h>
int main()
{
FreeConsole();
while(1)
{
BlockInput(true);
}
}