当前位置:网站首页>什么是数据类型?数据类型有什么用?
什么是数据类型?数据类型有什么用?
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 关键字测试一下)。
边栏推荐
猜你喜欢

HDMI2.1与HDMI2.0的区别以及转换PD信号。

Robots protocol

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

PAT甲级 1029 Median

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

Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico

一篇文章让你读懂-曼彻斯特编码

技术干货|百行代码写BERT,昇思MindSpore能力大赏
![[MySQL 11] how to solve the case sensitive problem of MySQL 8.0.18](/img/9b/db5fe1a37e0de5ba363f9e108310a5.png)
[MySQL 11] how to solve the case sensitive problem of MySQL 8.0.18

Technical dry goods | some thoughts on the future of AI architecture
随机推荐
技术干货|AI框架动静态图统一的思考
Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
What is definition? What is a statement? What is the difference between them?
HDMI2.1与HDMI2.0的区别以及转换PD信号。
技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
【踩坑系列】mysql 修改root密码失败
Enter three times and guess a number
Application of pigeon nest principle in Lucene minshouldmatchsumscorer
【MySQL 12】MySQL 8.0.18 重新初始化
【MySQL 13】安装MySQL后第一次修改密码,可以可跳过MySQL密码验证进行登录
技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer
基于RNA的新型癌症疗法介绍
static关键字
Redis profile
【MySQL 11】怎么解决MySQL 8.0.18 大小写敏感问题
输入三次猜一个数字
tp3.2和tp5.0的区别
UA camouflage, get and post in requests carry parameters to obtain JSON format content
Pat class a 1032 sharing
微软安全响应中心