0
我試圖將unsigned char轉換爲ascii文本。我該怎麼做? 我已經試過這一點,但它是錯誤的:如何打印unsigned char ascii
typedef struct mtmheader
{
unsigned char objName[20];
unsigned char msgType[2];
}mtmheader;
mtmheader h;
processMTMHeader(datap,&h, endmmsgp);
printf("Name, type: %s %c\n",(char *) &h.objName,(char *) &h.msgType);
編輯 我讀的無符號字節流,並想知道我怎麼能打印是ASCII文本。在printf中只有僞代碼,這是錯誤的。
請發佈一個示例輸入和你期望的輸出 – anatolyg