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