当前位置:网站首页>什么是数据类型?数据类型有什么用?
什么是数据类型?数据类型有什么用?
2022-07-03 07:42:00 【是北豼不太皮吖】
基本数据类型

什么是数据类型
数据类型就好像一个模子,short、int、long、char、float、double 这六个就是不同大小的模子。
数据类型有什么用
拿着它们在内存上咔咔咔,不同大小的内存就分配好了,当然别忘了给它们取个好听的名字。在 32 位的系统上 short 咔出来的内存大小是 2 个 byte;int 咔出来的内存大小是 4 个 byte;long 咔出来的内存大小是 4 个 byte;float 咔出来的内存大小是 4 个 byte;double 咔出来的内存大小是 8 个 byte;char 咔出来的内存大小是 1 个 byte。(注意这里指一般情况,可能不同的平台还会有所不同,具体平台可以用 sizeof 关键字测试一下)。
边栏推荐
- 项目经验分享:基于昇思MindSpore,使用DFCNN和CTC损失函数的声学模型实现
- PAT甲级 1029 Median
- OSPF protocol summary
- Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
- Reconnaissance et détection d'images - Notes
- Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
- 华为S5700交换机初始化和配置SSH和TELNET远程登录方法
- Go language foundation ----- 02 ----- basic data types and operators
- Segment read
- Go language foundation ----- 11 ----- regular expression
猜你喜欢

Go language foundation ----- 05 ----- structure

Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition

【LeetCode】2. Valid Parentheses·有效的括号

PAT甲级 1029 Median

Analysis of the eighth Blue Bridge Cup single chip microcomputer provincial competition

Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once

UA camouflage, get and post in requests carry parameters to obtain JSON format content

技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer

技术干货|关于AI Architecture未来的一些思考

Pat grade a 1027 colors in Mars
随机推荐
[MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
Lucene introduces NFA
[at] ABC 258g - triple Reach - violence
static关键字
Professor Zhang Yang of the University of Michigan is employed as a visiting professor of Shanghai Jiaotong University, China (picture)
Leetcode 198: house raiding
The difference between typescript let and VaR
PAT甲级 1032 Sharing
Redis view client connection
Inverted chain disk storage in Lucene (pfordelta)
Implementation of breadth first in aggregation in ES
Go language foundation ----- 13 ----- file
Go language foundation ------ 12 ------ JSON
PAT甲级 1030 Travel Plan
The concept of C language pointer
【MySQL 14】使用DBeaver工具远程备份及恢复MySQL数据库(Linux 环境)
优质博客——
项目经验分享:实现一个昇思MindSpore 图层 IR 融合优化 pass
Redis批量启停脚本
华为S5700交换机初始化和配置SSH和TELNET远程登录方法