当前位置:网站首页>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
边栏推荐
- C学习完结
- MySQL syntax collation (4)
- 深度学习环境搭建步骤—gpu
- An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
- redis优化系列(三)解决主从配置后的常见问题
- Decompile and get the source code of any wechat applet - just read this (latest)
- JS controls the file type and size when uploading files
- Codeworks round 783 (Div. 2) d problem solution
- 5 minutes to achieve wechat cloud applet payment function (including source code)
- DevOps集成-Jenkins 服务的环境变量和构建工具 Tools
猜你喜欢

I just want to leave a note for myself

Redis optimization series (III) solve common problems after master-slave configuration

MySQL syntax collation

開關電源設計分享及電源設計技巧圖解

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

Build intelligent garbage classification applet based on Zero

Class loading mechanism

White screen processing method of fulter startup page

精简CUDA教程——CUDA Driver API

Prefer composition to inheritance
随机推荐
Machine learning catalog
White screen processing method of fulter startup page
Zero base to build profit taking away CPS platform official account
Openlayers 5.0 discrete aggregation points
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Encyclopedia of professional terms and abbreviations in communication engineering
Transaction processing of SQL Server database
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
The usage of slice and the difference between slice and array
mysql通过binlog恢复或回滚数据
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
All table queries and comment description queries of SQL Server
An idea of rendering pipeline based on FBO
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
2021-2022-2 ACM集训队每周程序设计竞赛(8)题解
MySQL practical skills
openlayers 5.0 两种居中方式
SSDB foundation 1
Openharmony open source developer growth plan, looking for new open source forces that change the world!