我一直在尝试将小数转换为Mac地址,我使用SendArp函数获取mac地址,然后从那里我不知道如何处理数字任何帮助?这是我到目前为止所做的:
char * getMac(int IP)
{
char *Mac_Addr = (char*)calloc(sizeof(char*), 1024);
unsigned long DestMacAddr[2] = { 0 };
unsigned long PhysicalLength = 6;
int error = SendARP(htonl(IP), htonl(htonl(inet_addr("127.0.0.1"))), &DestMacAddr, &PhysicalLength);
return error == NO_ERROR? Mac_Addr: "";
}