0
我想查看这是否实际上可以在C代码中使用。如何在无符号数组中组合字符和数字char
unsigned char message[] = {0x00,0x00,"Hello world"};
有一些固件,我想迫使采取比为0x00其他人物在同一阵列英寸它有:
unsigned char message[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
已经写在里面。我希望它采取其他字符,因为这两个是可能的:
unsigned char message[] = "Hello world";
unsigned char message2[] = {0x00,0x00,0x00};
我有一个存储从一个UART的信件,我想在编译器告诉你
unsigned char message2[] = {0x00,0x00,0x00};
答:你不能。 – haccks 2014-09-25 17:09:12
你想做什么?你有很多这样的消息吗? – 2014-09-25 17:12:47
以及为什么你认为“Hello World”是一个字符或整数? – 2014-09-25 17:16:24