char *pStrBuffer;
unsigned char data;
unsigned int Address;
/* pStrBuffer reading from a file data in file of the form
WriteByte(0xDE04,0x20)
WriteByte(0xFE08,0x50) ....
*/
/* in a loop */
sscanf(pStrBuffer,"%x%x",&Address,&data);
Compiler is gnu gcc 4.5 in Windows XP
However the Value read for Address is 0xDE00 instead of 0xDE04 ? why is that so although value of data is read correctly.
I also tried to use %lx and %hx respectively but of no use
To read a single unsigned byte, use the
%hhxmodifier.%hxis for anunsigned short,%xis for anunsigned int,%lxis for anunsigned long, and%llxis for an `unsigned long long.