当前位置:网站首页>Storage of C language data in memory (1)
Storage of C language data in memory (1)
2022-07-28 20:15:00 【White Hibiscus KK】
stay C In language , There are many types of data . for example :char、int、float,double wait . These are all available in C Data types created in language , Then the write data type is in memory How much storage space does it occupy ? It's very simple, just use sizeof You can figure out how much space these data types occupy . As shown in the figure :

If you classify data types , Can be divided into Plastic surgery Family 、 Floating point family 、 Construction type 、 Pointer type and null type .
First of all Plastic surgery Family : Plastic surgery Family char、short、int、long.
Someone might be right char Feel confused ,char Isn't it the data type of characters , Why is it in the plastic surgery family ? In fact, I also had this doubt at first . Now let me answer for you :char Although it is the data type of characters , But when stored in memory , What is stored is the of characters ascii Code value ,ascii The code value is an integer . therefore char Plastic surgery Family .
Add : Usually, the variables we create are char n1,short n2,int n3,long n4. In fact, it is an ellipsis in this way .unsigned It's a sign free signed It's signed . Look at the picture below :

Floating point family :
float and double
An array type 、 Type of structure (struct)、 Enumeration type (enum) And joint types (union).

If you use char Express Positive numbers It can only mean 0~127 If it means negative Can be said -1~-128. Simply speaking char It can only mean -128 To 127 Integer between .
边栏推荐
- Two methods to judge the size end
- Find the memory occupied by the structure
- [C language] initial C language reflection and summary
- Solve flask integration_ Error reporting in restplus
- Handan, Hebei: expand grassroots employment space and help college graduates obtain employment
- 河北:稳粮扩豆助力粮油生产提质增效
- [C language] scanf format input and modifier summary
- [C language] guessing numbers game [function]
- WPF--实现WebSocket服务端
- C language implementation of strncpy
猜你喜欢

Can China make a breakthrough in the future development of the meta universe and occupy the highland?

Prometheus deployment

Store and guarantee rancher data based on Minio objects

Hebei: stabilizing grain and expanding beans to help grain and oil production improve quality and efficiency

Multi-Modal Knowledge Graph Construction and Application: A Survey

CDGA|工业互联网行业怎么做好数据治理?

Deploy ZABBIX automatically with saltstack

4. Const and difine and the problem of initializing arrays with const and define

JVM (24) -- performance monitoring and tuning (5) -- Analyzing GC logs
![[C language] simulation implementation of strlen (recursive and non recursive)](/img/73/e92fe714515491f1ea366d6924c9ec.png)
[C language] simulation implementation of strlen (recursive and non recursive)
随机推荐
为什么客户支持对SaaS公司很重要?
数字图像理论知识(一)(个人浅析)
Idea properties file display \u solution of not displaying Chinese
Solve the problem of adding the least number of parentheses (interval DP)
通配符 SSL/TLS 证书
6. Functions of C language, why functions are needed, how functions are defined, and the classification of functions
Using Lex (Flex) to generate lexical analyzer of PL language
9. Pointer of C language (2) wild pointer, what is wild pointer, and the disadvantages of wild pointer
Multi-Modal Knowledge Graph Construction and Application: A Survey
New fruit naming (DP is similar to the longest common subsequence)
Implementation of strcat in C language
Basic usage of docker
C+ + core programming
[C language] Pointer advanced knowledge points
Implementation of strstr in C language
Machine learning -- model evaluation, selection and verification
河北邯郸:拓展基层就业空间 助力高校毕业生就业
软考中级(系统集成项目管理工程师)高频考点
Use of strtok and strError
XOR operation and its usage