C

hex string 을 실제 hex값으로 변환하기

newkie 2012. 4. 16. 14:00

대충


macAddr[0] = "E"

macAddr[1] = "E"


sprintf(hexstr,"0x%c%c",macAddr[0],macAddr[1]);

Addr[0] = strtol(hexstr,err,16);


하면 Addr[0]에 0xEE!


EE!