当前位置:网站首页>Int and bit group turn to each other
Int and bit group turn to each other
2022-07-01 01:51:00 【Friendly, friend】
int Indexable array
#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];
}
}Digit group transfer int
Use :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());
边栏推荐
- Fast understanding of forward proxy and reverse proxy
- 45 year old programmer tells you: why do programmers want to change jobs? It's too true
- org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms)错误解决
- [fundamentals of wireless communication-15]: illustrated mobile communication technology and application development-3-overview of digital communication 2G GSM, CDMA, 3G wdcma/cdma200/td-scdma, 4G LTE
- P6773 [NOI2020] 命运(dp、线段树合并)
- (翻译)使用眉状文本提高标题点击率
- 模板:全局平衡二叉树
- 关于白盒测试,这些技巧你得游刃有余~
- 工厂+策略模式
- laravel 事件 & 监听
猜你喜欢

Analysis on user behavior loss of data exploration e-commerce platform

With regard to the white box test, you have to master these skills~

CorelDRAW 2022中文精简64位直装版下载

How does ZABBIX configure alarm SMS? (alert SMS notification setting process)

electron之坑addon

Short message sending solution in medical his industry

思特奇加入openGauss开源社区,共同推动数据库产业生态发展

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

工作6年,来盘点一下职场人混迹职场的黄金法则

Creating ASCII art with C #
随机推荐
[无线通信基础-14]:图解移动通信技术与应用发展-2-第一代移动模拟通信大哥大
数学知识:求组合数 III—求组合数
House change for agricultural products? "Disguised" house purchase subsidy!
Compile and install oh my Zsh
Fast understanding of forward proxy and reverse proxy
opencv -- 笔记
The personal test is effective, and the JMeter desktop shortcut is quickly created
Selenium classic interview question - multi window switching solution
工厂+策略模式
Composants de la grille de données portatifs
静态域与静态方法
Laravel+redis generates an order number - automatically increase from 1 on the same day
Last day of the second quarter
Sécurité et santé microbiennes, qu'est - ce que le traitement biologique?
Short message sending solution in medical his industry
[JS adds attributes to elements: setAttribute; classlist.remove; classlist.add;]
Electron pit Addon
7-2 拼题A打卡奖励 dp
Sun Yuchen told Swiss media Bilan that the bear market will not last long
Laravel event & subscription