当前位置:网站首页>int和位数组互转
int和位数组互转
2022-07-01 01:13:00 【友善啊,朋友】
int转位数组
#include <QDebug>
#include <bitset>
int main(int argc, char *argv[])
{
std::bitset<16> bits(1086);
bits[0] = 1;
for(std::size_t i = 0;i < bits.size();++i)
{
qDebug()<< bits[i];
}
}位数组转int
使用:QBitArray::toUInt32():
QBitArray bits(16);
bits.setBit(15);
bits.setBit(3);
bits.setBit(2);
bits.setBit(1);
qDebug()<<bits.toUInt32(QSysInfo::BigEndian);
qDebug()<<bits.toUInt32(QSysInfo::LittleEndian);
QByteArray array = bits.bits();
qDebug()<<QString(array.toHex());
边栏推荐
- 面对产业互联网的时候,甚至还用消费互联网的方式和方法去落地和实践产业互联网
- 3500 word summary: a complete set of skills that a qualified software testing engineer needs to master
- Working for eight years as a programmer, but with a salary of three years after graduation, it's too late to be enlightened again
- QT web 开发 - video -- 笔记
- Test essential tool - postman practical tutorial
- 3dsmax plug-in development traversal node object and object acquisition and inode transformation matrix description
- [无线通信基础-14]:图解移动通信技术与应用发展-2-第一代移动模拟通信大哥大
- 远程办公如何保持高效协同,实现项目稳定增长 |社区征文
- Open3d point cloud bounding box
- org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms)错误解决
猜你喜欢

哪有什么未来可期,不过是打工人临死前最后的幻想罢了

7-2 拼题A打卡奖励 dp

Gin configuration file

electron之坑addon
![[无线通信基础-14]:图解移动通信技术与应用发展-2-第一代移动模拟通信大哥大](/img/fa/f9bad44147ba9af21183b7bd630e32.png)
[无线通信基础-14]:图解移动通信技术与应用发展-2-第一代移动模拟通信大哥大

1500w播放下还藏着什么热点?B站2个未来趋势你不得错过

There is no future to be expected. It is just the last fantasy of a migrant worker before he dies

Neo4j installation, operation, project construction and function realization
![[无线通信基础-15]:图解移动通信技术与应用发展-3- 数字通信2G GSM、CDMA、3G WDCMA/CDMA200/TD-SCDMA、4G LTE、5G NR概述](/img/22/1efa444220131359b06005f597c9db.png)
[无线通信基础-15]:图解移动通信技术与应用发展-3- 数字通信2G GSM、CDMA、3G WDCMA/CDMA200/TD-SCDMA、4G LTE、5G NR概述

Batch import of Excel data in applet
随机推荐
用 Flutter 的 Canvas 画点有趣的图形
【多源bfs】934. Shortest Bridge
7-2 拼题A打卡奖励 dp
AS400 大廠面試
Log4j2 ThreadContext日志链路追踪
VirtualBox 安装增强功能
[dynamic planning] path dp:931 Minimum Falling Path Sum
微生物安全与健康,什么是生物处理?
System. Csrebot for commandline
Mysql database foundation: process control
php将二维数组元素转为键值对
Handsontable數據網格組件
go导入自建包
Use of laravel carbon time processing class
聚焦绿色低碳,数据中心散热进入“智能冷却”新时代
Upstream and downstream in software development
What are the functions of soil microorganisms in microbial detection?
那些一门心思研究自动化测试的人,后来怎样了?
Last day of the second quarter
如何选择券商?另外,手机开户安全么?