当前位置:网站首页>Learning notes on February 18, 2022 (C language)
Learning notes on February 18, 2022 (C language)
2022-06-25 14:55:00 【Smart_ auspicious】
22/2/5 Learning notes (Part 3)
Preliminary common keywords
auto - Automatically - Each local variable consists of auto modification ( Basically, they have been omitted , There are other uses in the new grammar .)
break
case
char
const
continue
default - Default -
do
double
else
enum - enumeration -
extern - Declare external symbols -
float
for
goto
if
int
long
register - Register key - It is recommended to store in the register ( A lot of frequently used data , But today compilers automatically recognize )
return
short
signed - The signed , Example positive and negative -
sizeof
static - Static -
1、static Modify local variables ( Changing the life cycle of local variables , Essentially changes the storage type of variables .)
2、static Modify global variable ( Global variables can be used throughout the project , Because global variables have external link properties .)
static After modifying global variables , Make the whole global variable Only in their own source file (.c) It can be used internally , Other source files cannot be used ! because static After modification , Global variables become internal link properties , Other source files cannot link this static global variable .
3、static Modify function ( Be similar to static Modify global variable .)
static After decorating the function , The function You can only use it inside your own source file , Essentially ,static Changed link properties .struct
switch
typedef - Type as defined -
typedef unsigned int u_int;// Alias
int main()
{
unsigned int num = 100;
u_int num2 = 100;// At this point, the two code definitions are the same
return 0;
}
- union - Consortium -
- unsigned
- void - nothing 、 empty -
- volatile
- while
define Define constants and macros
define It's a preprocessing instruction .
- define Defining macro :
#define ADD(X,Y) X+Y
int main()
{
printf("%d\n",ADD(2, 3));// The result is 5
return 0;
}
#define ADD(X,Y) X+Y
int main()
{
printf("%d\n", 4*ADD(2, 3));// The result is 11,4*2+3 = 8+3 =11
return 0;
}
#define ADD(X,Y) ((X)+(Y))// Defined as a macro , Instead of a simple number
int main()
{
printf("%d\n",4*ADD(2, 3));// The result is 20
return 0;
}
The pointer
Memory
Memory is a very important memory on a computer , All programs in the computer run in memory .
Memory is divided into small memory units , The size of each memory unit is 1 Bytes .
For effective access to each unit of memory , Memory units have numbers , These numbers are called the address of the memory unit .How memory is numbered ?
32 position —32 Root address line — Physical line — Electrify —1/0 2^32 Root address line ( Memory units )
64 position —64 Root address line — Physical line — Electrify —1/0 2^64 Root address line ( Memory units )How big is a memory unit ?
One byte per memory unit 8 individual bit.Query address code :


Pointer size

Structure
- Structure can make C Language Create a new type come out .
- Structural variable . Member variables

little tips
- About Storage type

- "%p\n" Specifically for printing addresses .
- pa It's used to store the address , stay c In language, it is called pointer variable .
边栏推荐
- Native JS obtains form data and highlights and beautifies JSON output display
- QQ love talk candy love talk content acquisition and storage
- For the first time in China, Chinatelecom 5g underground personnel positioning project is officially commercial: it can track the position in real time to ensure operation safety
- 网上股票开户安不安全?有谁知道呢
- H5 page graying source code, ie compatible (elegant downgrade provides download browser link)
- 【HBZ分享】LockSupport的使用
- Source code analysis of zeromq lockless queue
- JGG | overview of duhuilong group of Hebei University Research on plant pan genomics
- Sequential programming 1
- How to view the Chrome browser plug-in location
猜你喜欢

15 -- k points closest to the origin

In 2022, the score line of Guangdong college entrance examination was released, and several families were happy and several worried

C language escape character and its meaning

About the problem of kicad stuck in win10 version, version 6 x

重磅!国产 IDE 发布,由阿里研发,完全开源!(高性能+高定制性)

Heavyweight! The domestic IDE is released and developed by Alibaba. It is completely open source! (high performance + high customization)

One question per day,

Uniapp icon configuration

How to cut the size of a moving picture? Try this online photo cropping tool

Judging the number of leap years from 1 to N years
随机推荐
网上股票开户安不安全?有谁知道呢
【Try to Hack】vulnhub DC1
How to combine multiple motion graphs into a GIF? Generate GIF animation pictures in three steps
搭建极简GB28181 网守和网关服务器,建立AI推理和3d服务场景,然后开源代码(一)
PubSub JS library realizes "cross component" data transfer
Where is it safe to open an account for buying funds? Ask for guidance
HMS core machine learning service realizes simultaneous interpretation, supports Chinese-English translation and multiple voice broadcast
How to view the Chrome browser plug-in location
Native JS obtains form data and highlights and beautifies JSON output display
成员变量与局部变量的区别
Gif动画怎么在线制作?快试试这款gif在线制作工具
HMS Core机器学习服务实现同声传译,支持中英文互译和多种音色语音播报
Application of TSDB in civil aircraft industry
Flexible layout (display:flex;) Attribute details
BM setup process
Design and implementation of timer
JS Base64 Library Learning
重磅!国产 IDE 发布,由阿里研发,完全开源!(高性能+高定制性)
How to cut the size of a moving picture? Try this online photo cropping tool
[deep learning] multi label learning