Data type & variable naming rules & escape characters (concept and detailed explanation)

type of data: 

serial number symbol type Space size (bytes) initialization
1 char character data type 1 char = 'a' ; or char = "abc";
2 short short integer 2 short a = 0;
3 int plastic surgery 4 int a = 0;
4 long long integer 4 long a =0;
5 long long longer shaping 8 long long a = 0;
6 float single precision floating point 4 float a = 12.1f ;
7 double double precision floating point 8 double a = 12.12

Computer space unit conversion relationship:

The smallest unit: bit  

1 byte (byte) 8 bit
1 KB 1024 byte
1MB 1024 KB
1GB 1024 MB
1TB 1024 GB
1PB 1024 TB
...... ......

Variable Naming Rules

⭕ can only consist of letters (both uppercase and lowercase), numbers, and underscores ( _ ).

⭕ cannot start with a number.

⭕The length cannot exceed 63 characters.

⭕Case-sensitive in variable names.

⭕Variable names cannot use keywords.

 escape character

        Escape character (Escape character), all ASCII codes can be represented by "\" plus numbers (usually octal numbers). C defines some letters preceded by "\" to represent common ASCII characters that cannot be displayed, such as \0, \t, \n, etc., which are called escape characters, because the following characters are not original The ASCII characters mean it.

escape character paraphrase
  \? Used when writing multiple question marks in a row, preventing them from being parsed into three-letter words
  \' Used to represent character constants'
  \" Used to denote double quotes inside a string
  \\ Used to denote a backslash, preventing it from being interpreted as an escape sequence
 \a warning character, beep
  \b backspace
  \f Feed character
  \n new line
  \r carriage return
  \t horizontal tab
  \v vertical tab
  \ddd ddd represents 1~3 octal numbers. Such as: \130 X
  \xdd dd means 2 hexadecimal digits. Such as: \x30 0

Guess you like

Origin blog.csdn.net/m0_75215937/article/details/130896609