Trying to learn C++ here, I was playing with the main function return value, and when the return value is 1, I still got from the debugging console saying
"The program '/Users/zzli/Documents/GitHub/Codes/C++/HelloWorld' has exited with code 0 (0x00000000)."
Isn't the program should exit with code 1 in this case?
Here is my code:
#include <iostream>using namespace std;int main(){ cout << "Hello World! \n"; int a = 8; if (a==8) { return 1; } else { return 0; }}
and here is the debugging console screenshot:enter image description here
I have tried other values as the return value of the main function, however I still get the "exited with code 0" message.