当前位置:网站首页>整形的分类: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字节
边栏推荐
- 2022.7.4-----leetcode. one thousand and two hundred
- Example 006: Fibonacci series
- Shell script
- Take you to understand the working principle of lithium battery protection board
- 实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
- Weidongshan Internet of things learning lesson 1
- STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
- Shell script realizes the reading of serial port and the parsing of message
- Typical low code apaas manufacturer cases
- 实例006:斐波那契数列
猜你喜欢

MHA High available Cluster for MySQL

Tailq of linked list

Summary of SIM card circuit knowledge

STM32 virtualization environment of QEMU

Talk about the function of magnetic beads in circuits

Bluebridge cup internet of things competition basic graphic tutorial - clock selection

Various types of questions judged by prime numbers within 100 (C language)

UE pixel stream, come to a "diet pill"!

猜谜语啦(3)

MATLAB小技巧(28)模糊综合评价
随机推荐
How to write cover letter?
Explain task scheduling based on Cortex-M3 in detail (Part 1)
Slist of linked list
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
Low code platform | apaas platform construction analysis
Installation and use of libjpeg and ligpng
Esphone retrofits old fans
Arduino operation stm32
Esphone Feixun DC1 soft change access homeassstant
剑指 Offer 06. 从尾到头打印链表
STM32 single chip microcomputer - bit band operation
Example 006: Fibonacci series
UE pixel stream, come to a "diet pill"!
Management and use of DokuWiki (supplementary)
第十八章 使用工作队列管理器(一)
STM32 tutorial triple ADC interleaved sampling
Negative pressure generation of buck-boost circuit
696. 计数二进制子串
实例002:“个税计算” 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.
Array integration initialization (C language)