+ 2
#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 9; }
in c++ the out put is the same as return 0; why??
6 Respostas
+ 4
It's just by definition that 0 means "everything ok".
If people had agreed on "1 means everything ok", then it would be return 1;
But they decided on 0
+ 2
That output is for the OS. It can be used in batch jobs
+ 2
If it returns 0, it means everything went fine.
Other values mean different error codes, to tell what went wrong in the programm, even when it hit the end.
+ 1
so what is the purpose to use the 0 here is my question?
+ 1
Matthias, i got you; Thank you!