gpt4 book ai didi

c++ - 在 C++ 中将 uint8_t 数组转换为位集

转载 作者:行者123 更新时间:2023-11-30 05:27:54 25 4
gpt4 key购买 nike

<分区>

有没有一种快速的方法可以将 uint8_t 数组转换为 biteset。

uint8_t test[16]; 
// Call a function which populates test[16] with 128 bits
function_call(& test);
for(int i=0; i<16; i++)
cout<<test[0]; // outputs a byte
cout<<endl;
std:: bitset<128> bsTest;

我试过了,但是不行

bsTest(test);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com