Data Type:Long 32-bit 4-byte 64-bit 8-byte vs2013 4-byte long 8-byte float 4-byte double 8 byte
Difference between % x and % P:Int main (){
Int num = 256; printf ("% P \ n", & num); // 0107 fafc printf ("% # P \ n", & num); // 0x0133 fafc
Printf ("% x \ n", & num); // 107 fafc printf ("% # x \ n", & num); // 0x0000fafc
}
Complement:The original code of a positive number is the same as the original code of a negative number. The original code of a negative number is the same as the original code of another normal negative number. remove and Add 1
-5 original code 1000 0101 makeup Code 1111 1011
Original code 1000 0101
Truncation:
#include <stdio.h>
int main()
{
Int num = 5555; // hexadecimal 0x15b3
Small-end storage B3 15 ----- memory
unsigned char c
= Num; // B3 Only leaves low bytes
Printf ("% d \ n", c); // output 179
}
The bug that occurs when the unsigned type and INT type are added:Unsigned int A = 6; A +-10> 0 // This sentence is correct, because-10 is an int converted to an unsigned int negative number, it will become a very large positive number. // The sum is definitely greater than 0.
#include <stdio.h>
int main()
{
unsigned int a = 6;
If (a-10> 0) // The result is treated as an unsigned integer.
{
printf("aaaaaaaaa\n");
}
}
The output result is aaaaaaaaa.
3.14:3.14 The default value is double type. To change to float type, use 3.14f.
, (Comma) OPERATOR:The result is the last value of int max = 5, 6, 10; => max = 10;
% Remainder OPERATOR:A negative number can be used for remainder. The result is the same as that of the devisor, but the floating point cannot be used for remainder.
From Weizhi note (wiz)
7.24 data type operator Complement