我尝试将一些位与 c 中的 uint8_t 类型的数组连接起来,如下所示:
int main(int argc, char **argv) {
if(argc < 2) {
printf("Usage: %s <Input _message>\n", argv[0]);
return -1;
}
uint8_t L_length_of_message =strlen(argv[1]);
num_0's_in_bits_addedd=13; // try to || 13 bit with array
uint8_t msg[L_length_of_message];
//assume this msg is already converted in hex format
现在我,e msg=0xabcf123; 我想将 13(位)与 msg i,e 连接起来;
msg=0xabcf123;
msg_in_bits=1010101111001111000100100011
zeors_added_in_bits=0000000000000;
new_msg_in_bits=10101011110011110001001000110000000000000;
new_msg=0x1579e246000
主要问题是消息存储在 char 数组中,因此多位移位操作不起作用。建议一些解决问题的方法??