Quote (carteblanche @ Apr 9 2017 10:48am)
not a c expert. off-hand, i think sprintf will give you a string instead of printing to console. then you can use whatever c's substring is to separate the digits.
Thanks for the tip. =)
Here is my solution. Don't mind the cryptic variables names. It could be cleaned up a fair bit but finally got it.
Code
char * p = (char *)&mmemory[x];
char pa[MAX_BUFFER];
sprintf(pa,"%x",p);
printf("\n\n%s",pa);
int len = strlen(pa);
int len1 = len/2;
int len2 = len - len1;
char *s1 = malloc(len1+1); // one for the null terminator
memcpy(s1, pa, len1);
s1[len1] = '\0';
char *s2 = malloc(len2+1); // one for the null terminator
memcpy(s2, pa+len1, len2);
s2[len2] = '\0';
printf("\ns1=%s",s1);
printf("\ns2=%s\n\n",s2);
This post was edited by ROM on Apr 10 2017 09:12pm