当前位置:网站首页>C语言的十六进制printf为何输出有时候输出带0xFF有时没有
C语言的十六进制printf为何输出有时候输出带0xFF有时没有
2022-04-23 19:24:00 【ToneChip】
unsigned short aaa = 0xC000;
printf("0x%x \n", (aaa << 8) );
输出 0xC00000
再写一个下面这种
short aaa = 0xC000;
printf("0x%x \n", (aaa << 8) );
输出:0xFFC00000
这是因为下面这个short定义的是一个带符号位的16Bit,左移之后,也是对应的带符号的int
版权声明
本文为[ToneChip]所创,转载请带上原文链接,感谢
https://tonechip.blog.csdn.net/article/details/121785366
边栏推荐
- 深度学习环境搭建步骤—gpu
- 高层次人才一站式服务平台开发 人才综合服务平台系统
- Wechat applet part of the mobile phone Preview PDF did not respond
- Go recursively loops through folders
- On the forced conversion of C language pointer
- SSDB foundation 2
- 网络协议之:sctp流控制传输协议
- All table queries and comment description queries of SQL Server
- An example of using JNI to directly access surface data
- Pdf reference learning notes
猜你喜欢

山大网安靶场实验平台项目-个人记录(五)

Decompile and get the source code of any wechat applet - just read this (latest)

深度学习——特征工程小总结

Wechat applet part of the mobile phone Preview PDF did not respond

Class loading mechanism

优先使用组合而不使用继承

为何PostgreSQL即将超越SQL Server?

Openharmony open source developer growth plan, looking for new open source forces that change the world!

Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项

Common SQL commands
随机推荐
js上传文件时控制文件类型和大小
Wechat video extraction and receiving file path
MySQL syntax collation (2)
開關電源設計分享及電源設計技巧圖解
ArcMap publishing slicing service
The platinum library cannot search the debug process records of some projection devices
点云数据集常用处理
Openlayers draw rectangle
C学习完结
2021-2022-2 ACM集训队每周程序设计竞赛(8)题解
Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
Virtual machine performance monitoring and fault handling tools
Switching power supply design sharing and power supply design skills diagram
ArcGIS JS API dojoconfig configuration
Go modules daily use
The difference between underline and dot of golang import package
On the forced conversion of C language pointer
MySQL syntax collation (4)
Convert string to JSON
MySQL syntax collation (5) -- functions, stored procedures and triggers