C++ Programs return int type, so why does return -1 return 255? [duplicate]
问题 This question already has answers here : Return value range of the main function (7 answers) Closed 4 years ago . Note that I am running a linux machine, although I don't think the result is different on a windows (or other) machine. This is a simple question - C++ programs usually return a 32 bit int. If I return -1 , and then print the result from the terminal, the result is 255 . Why is this? I feel link this is something I should know, or should have noticed many years ago - I never