Note: Based on learning rectification C program design, online search for personal summary of some practical application of knowledge
The data has integer type, floating point type, character type data
(1) Define Integer data:
Integer (int) 16-bit 2-byte -32768~32767
Short int 16 bits 2 bytes -32768~32767
Long int 32 bits 4 bytes
unsigned integer (unsigned int) 16-bit 2-byte 0~65535
unsigned short integer (unsigned) 16-bit 2-byte 0~65535
unsigned long integer (unsigned long int) 32 bits 4 bytes
Decimal, octal (0 flag), Hex (0x flag)
(2) Define floating-point data:
Single-precision floating-point (float) 32-bit 4-byte
Double-precision floating-point (double) 64-bit 8-byte
Long double precision floating point type (long double) 128 bits
Note: Floating-point data operations sometimes have rounding errors
(3) Define the character type data:
Character data (char) 8 bits 1 bytes
unsigned character data (unsigned char) 8 bits 1 bytes
(4) Constants
Integral type constant: 1,2,3,4 ...
Real constants: 1.2,-0.12 ....
Character constants: ' A ', ' B ' ... a=97 a=65
Symbolic constants: Constants defined #define NUM 30 macros
(5) Variables
A person thinks that defining a variable is a container in memory that can change the contents of a container, but the container itself will not change.
For example, a variable of type int a,a can be either 1 or 2, but the address and type of a will not change.
Note: 1. Variables can only consist of letters, numbers, underscores, and the first character must be a letter or underline
2. Variables are case-sensitive, for example, int num and int num represent two variables
C Learning Notes (i) data, operators, expressions