I'm trying to convert unsigned char to ascii text. How can I do it? I have tried this, but it is wrong:
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);
EDIT I read stream of unsigned bytes and want to know what how can i print is as ascii text. In printf is only pseudo code, which is wrong.