求助给位高手了
是这样我从web中读取到了一个字符串是 mac1=44&mac2=f3&mac3=ed&mac4=34,我想把44 f3 ed 34按照16进制存在一个数组中 弄好长时间了 谢谢各位了 ~~~在线等 好急 用c语言
[解决办法]
- C/C++ code
#include <string.h>#include <stdio.h>int main(int argc, char* argv[]){ char str[] = "mac1=44&mac2=f3&mac3=ed&mac4=34"; unsigned char hexs[4]; sscanf(str, "mac1=%02x&mac2=%02x&mac3=%02x&mac4=%02x", &hexs[0], &hexs[1], &hexs[2], &hexs[3]); printf("%02x %02x %02x %02x\n", hexs[0], hexs[1], hexs[2], hexs[3]); return 0;}
[解决办法]