Greetings. Is there any way to accomplish the following using 'unsigned char' 
instead of 'unsigned int'?

unsigned int addr[6];

(void) sscanf("01:23:45:67:89:AB", "02X:02X:02X:02X:02X:02X", &addr[5], 
&addr[4], &addr[3], &addr[2], &addr[1], &addr[0]);

Since the address represented by the string is really 6 bytes I was hoping to 
convert directly. However, with my current format string sscanf expects the 
target locations to be unsigned int's. Using unsigned char's for the array 
expectedly results in a memory error. I could do it manually but if it can be 
accomplished with an existing function I'd rather use that.

I see a solution here www.codeproject.com/KB/cpp/MACAddressUtility.aspx[1] 
which suggests to me sscanf will not suit my purposes.

Thanks. Jerry.


Links:
------
[1] http://www.codeproject.com/KB/cpp/MACAddressUtility.aspx


[Non-text portions of this message have been removed]

Reply via email to