Assuming proper byte ordering and length of integer as 32 bits:
unsigned char message[50]; // your message here
int status;
int statusFiscal;
char text[41];
memcpy(&status, message, 4);
memcpy(&statusFiscal, message+5);
memcpy(text, message+10, 40);
text[40] = '\0';
printf("status: %d\nfiscal: %d\ntext:%s\n", status, statusFiscal, text);
unsigned char message[50]; // your message here
int status;
int statusFiscal;
char text[41];
memcpy(&status, message, 4);
memcpy(&statusFiscal, message+5);
memcpy(text, message+10, 40);
text[40] = '\0';
printf("status: %d\nfiscal: %d\ntext:%s\n", status, statusFiscal, text);
To copy to clipboard, switch view to plain text mode
Bookmarks