如 字符串"aaaaaaaaaaaa"转化为类似
DWORD SendARP(
IPAddr DestIP, // destination IP address
IPAddr SrcIP, // IP address of sender
PULONG pMacAddr, // returned physical address
PULONG PhyAddrLen // length of returned physical addr.
);
中 PULONG pMacAddr,类型。谢谢
比较急 分不够还有
用api嘛
这个是我写的,应该没有问题
char MacAddr[]="005345000000";
char *pBuf=MacAddr;
char *Addr=pMacAddr;
char temp=0;
for(int i=0;i<6;i++)
{
temp=0;
if(*pBuf>=0x30&&(*pBuf)<=0x39)
temp=(*pBuf-0)*16;
else
if(*pBuf>0x40&&(*pBuf)<0x47)
temp=(*pBuf-31)*16;
else
if(*pBuf>0x60&&(*pBuf)<0x67)
temp=(*pBuf-87)*16;
pBuf++;
if(*pBuf>=0x30&&(*pBuf)<=0x39)
temp=temp+(*pBuf-0);
else
if(*pBuf>0x40&&(*pBuf)<0x47)
temp+=(*pBuf-31);
else
if(*pBuf>0x60&&(*pBuf)<=0x67)
temp+=(*pBuf-87);
pBuf++;
*Addr=temp;
Addr++;
}
up