hello, thanks for pointing me in the right direction. Sorry to be a pain but i just cant get my head around how this works. I have found a relatively simple looking example from the internet but i cnt see how I can use this to achieve what Im after.
I have attempted to put something together which im not sure follows the proper logic but my attempt was to transfor each unsigned char using 'x' so that the byte transforms into its hex values then store the hex values into the buffer, hopefully ending up with the buffer containing the hex values of the four bytes.
I not even sure if my code is even on the right lines but it seems to be giving me back an error of "unterminated string or character constant in function"
Code:
unsigned char VS1,VS2,VS3,VS4;
infile.read (&VS1,sizeof (VS1)) ;
infile.read (&VS2,sizeof (VS2)) ;
infile.read (&VS3,sizeof (VS3)) ;
infile.read (&VS4,sizeof (VS4)) ;
char buffer [50];
VS1=sprintf (buffer, "%x);
VS2=sprintf (buffer, "%x);
VS3=sprintf (buffer, "%x);
VS4=sprintf (buffer, "%x);
return 0;