当前位置:网站首页>什么是数据类型?数据类型有什么用?
什么是数据类型?数据类型有什么用?
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 关键字测试一下)。
边栏推荐
- Go language - loop statement
- 技术干货 | AlphaFold/ RoseTTAFold开源复现(2)—AlphaFold流程分析和训练构建
- [MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
- Static keyword
- Go language foundation ----- 06 ----- anonymous fields, fields with the same name
- 技术干货|昇思MindSpore NLP模型迁移之Roberta ——情感分析任务
- s7700设备如何清除console密码
- 項目經驗分享:實現一個昇思MindSpore 圖層 IR 融合優化 pass
- Lucene merge document order
- [at] abc 258G - Triangle 三元組可達-暴力
猜你喜欢
Application of pigeon nest principle in Lucene minshouldmatchsumscorer
Go language foundation ------ 14 ------ gotest
技术干货|昇思MindSpore Lite1.5 特性发布,带来全新端侧AI体验
PAT甲级 1031 Hello World for U
【LeetCode】3. Merge Two Sorted Lists·合并两个有序链表
Technical dry goods Shengsi mindspire operator parallel + heterogeneous parallel, enabling 32 card training 242 billion parameter model
圖像識別與檢測--筆記
Go language foundation ------ 12 ------ JSON
技术干货|昇思MindSpore创新模型EPP-MVSNet-高精高效的三维重建
EtherCAT state machine transition (ESM)
随机推荐
PHP common sorting algorithm
Segment read
华为交换机Console密码重置、设备初始化、默认密码
LwIP learning socket (API)
yarn link 是如何帮助开发者对 NPM 包进行 debug 的?
The difference between typescript let and VaR
Lucene skip table
Technical dry goods Shengsi mindspire innovation model EPP mvsnet high-precision and efficient 3D reconstruction
Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
技术干货|昇思MindSpore可变序列长度的动态Transformer已发布!
Precautions for opensips and TLS SIP trunk docking
Research shows that breast cancer cells are more likely to enter the blood when patients sleep
The concept of C language pointer
Go language foundation ----- 04 ----- closure, array slice, map, package
微软安全响应中心
Go language foundation ----- 07 ----- method
Project experience sharing: realize an IR Fusion optimization pass of Shengsi mindspire layer
Traversal in Lucene
PAT甲级 1030 Travel Plan
Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition