64,649
社区成员
发帖
与我相关
我的任务
分享
#include <stdlib.h>
unsigned char mac[6];
const char * str = "aabbccddeeff";
int i;
char temp[2];
for(i=0;i<6;i++)
{
temp[0] = str[2*i];
temp[1] = str[2*i+1];
mac[i] = strtol(temp,NULL,16);
}