C language basics - data types

1. Basic types

1.1 Constants and variables

(1) Constant: A quantity whose value cannot be changed during the running of the program.

整型常量:1, 2, 3
实型常量:3.14
字符型常量:'a'	// 在内存中存放的是a对应的ASCII码97
字符串常量:"a", "abc"

(2) Variable: The amount whose value can change during the running of the program

int a = 10;
a = 20;

1.2 Character data

1.2.1 Character constants

(1) Direct constants: enclosed in single quotes, such as 'a', 'b'
(2) Escape characters: starting with a backslash "\n", followed by one or several characters, such as '\n' Line break, '\t' means tab character, '\' means backslash (\), '%%' means percent sign (%)

1.2.2 Character variables

2. Structure type

3. Type conversion

4. Pointer

Guess you like

Origin blog.csdn.net/weixin_42214237/article/details/132981220