T.T*_*.T. 1 c c++ windows networking char
期待比较两个
BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
Run Code Online (Sandbox Code Playgroud)
其中byte在windows中定义为 typedef unsigned char BYTE;
我需要比较记忆吗?
谢谢!
注意:PhysicalAddress正如文档中所解释的那样,定义是
BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
Run Code Online (Sandbox Code Playgroud)
也就是说,它是一个数组的BYTE秒.不过,你可以用轻松地比较他们memcmp的<string.h>(或者<cstring>,如果你是用C++):
// The two structures
IP_ADAPTER_ADDRESSES iaa1, iaa2;
// The result of the comparison
int result;
//...
if(iaa1.PhysicalAddressLength!=iaa2.PhysicalAddressLength)
{
// We have two physical addresses of two different lengths; depending on what
// you want to do it may be an error or just a simpler case of comparison
}
else
{
// Perform the comparison
result = memcmp(iaa1.PhysicalAddress, iaa2.PhysicalAddress, iaa1.PhysicalAddressLength);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4749 次 |
| 最近记录: |