/* Int signed 0 xffffffff =-10 xfffffffe =-2 min 0x80000000 =-21 4748 Max 0x7fffffff = 21 3648x4748 = 10x36470 = 0int unsigned maximum 0 xffffffff = 42 9496 7295 0x80000000 = 21 4748 36480x7fffffff = 21 4748 3647 Minimum 0x00000000 = 0 */
Intmain () {/* parameter 5 is int type, 32-bit platform is 4 bytes, and 4 bytes of memory is allocated in the stack for storing parameter 5. The % F symbol will regard this parameter as double type, and the printf function will automatically convert float to double type, so the stack reads 8 bytes. Therefore, memory access is out of bounds. */Printf ("5 = % F \ n", 5);/* The parameter 5.01 is double type and is stored in 8 bytes. % D reads only four of the four bytes. */Printf ("5.01 = % d \ n", 5.01 );}
/*
[[Email protected] test_class] #./A. Out
5 = 0.000000
5.01 = 1889785610
[[Email protected] test_class] #./A. Out
5 = 0.000000
5.01 = 1889785610
[[Email protected] test_class] #./A. Out
5 = 0.000000
5.01 = 1889785610
*/