Good night,
Take as example the follow program:
int main()
{
return 0;
}
Everything works fine and I get the follow message on the console indicating that the program exited with code 0:
hh:mm:ss: /path/to/executable exited with code 0
Now when I try this:
int main()
{
return -1;
}
I get the same message, except that it says that I exited with code 255:
hh:mm:ss: /path/to/executable exited with code 255 (instead of -1):
Now switching to return 256
it says that the program exited with code 0
, which make me think that it should be actually unsigned char main()
instead of int main()
, since that the return type behaves like a unsigned char
type.
Why does that happen?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire