Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,我在整数数组中存储了一个“位”
int a = {1,0,1,1}
如何将整数数组“位”转换为无符号字符“位”?
和互惠的?
int int_array[] = {1, 0, 1, 1}; unsigned char uc_array[sizeof int_array / sizeof *int_array]; for (size_t i = 0; i != sizeof int_array / sizeof *int_array; ++i) uc_array[i] = int_array[i];
(您的示例代码有缺陷:标量变量的初始化程序太多)