Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这样的 C++ 代码
int main(int argc, char** argv){ exit(-1); }
我在 Windows 机器上,在 Cygwin 中制作和运行这个程序。我想回显返回值(用于测试目的)。
echo $?
给出 255 的 -1,为什么?(溢出?)
exit takes integers (0-255), return -1 is different, exit returns 255 when given value out of range
return -1