当前位置:网站首页>整形的分类:short in long longlong
整形的分类:short in long longlong
2022-07-05 08:32:00 【明月清风-精进不止】
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
short a = 0xffff;
int b = 0xffffffff;
long c = 0xffffffffL;
long long d = 0xffffffffffffffffLL;
printf("a = %hx\n", a);
printf("b = %x\n", b);
printf("c = %lx\n", c);
printf("d = %llx\n", d);
return 0;
}
运行结果如下:
整形变量占用内存的大小与操作系统有关:
short 2字节
int 4字节
long windows:4字节 linux32位 4字节 linux64位 8字节
longlong 8字节
边栏推荐
猜你喜欢
OC and OD gate circuit
Lori remote control commissioning record
Sword finger offer 09 Implementing queues with two stacks
每日一题——输入一个日期,输出它是该年的第几天
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
剑指 Offer 09. 用两个栈实现队列
Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase
每日一题——替换空格
Bluebridge cup internet of things basic graphic tutorial - GPIO input key control LD5 on and off
MySQL之MHA高可用集群
随机推荐
猜谜语啦(5)
2020-05-21
Let's briefly talk about the chips commonly used in mobile phones - OVP chips
Cinq détails de conception du régulateur de tension linéaire
Example 009: pause output for one second
How to write cover letter?
MHA High available Cluster for MySQL
实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
猜谜语啦(8)
Low code platform | apaas platform construction analysis
Weidongshan Internet of things learning lesson 1
C language data type replacement
Esphone retrofits old fans
Installation and use of libjpeg and ligpng
Matlab tips (28) fuzzy comprehensive evaluation
Arrangement of some library files
剑指 Offer 06. 从尾到头打印链表
猜谜语啦(4)
go依赖注入--google开源库wire
Arduino burning program and Arduino burning bootloader