Why does the program return with an exit code other than I specified?

匆匆过客 提交于 2019-11-28 13:49:57
cadaniluk

While the main function in C returns an int, operating systems don't necessarily use int as the error code.

700 in binary is 1010111100.
Truncating this value to eight bits yields 10111100.
This equals 188 in decimal.

That means your OS uses eight bits for error codes.1


1 Or possibly nine bits because the 8th bit (we start counting from 0, mind you) is 0 here. This is highly improbably due to 9 not being a power of 2, though, as is convention for data widths.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!