About INT data overflow

xiaoxiao2021-03-06  42

Main () {Int a = 32767; int b = -32768; Printf ("a =% D; / NB =% D; / N", a, - b);} The above code is run in Turbo C The results are as follows: a = -32768; b = 32767; Use Windows CL or GCC results are as follows: a = 32768; B = -32769; It can be seen from the importance of compilers. Why is it different? I do not know either. Continue to learn!

转载请注明原文地址:https://www.9cbs.com/read-60315.html

New Post(0)