【发布时间】:2011-05-13 17:42:12
【问题描述】:
嗨,
如何在 MFC(VC++) 中对 CString 值进行按位与 (&)? 示例:
CString NASServerIP = "172.24.15.25";
CString SystemIP = " 142.25.24.85";
CString strSubnetMask = "255.255.255.0";
int result1 = NASServerIP & strSubnetMask;
int result2 = SystemIP & strSubnetMask;
if(result1==result2)
{
cout << "Both in Same network";
}
else
{
cout << "not in same network";
}
如何对 CString 值进行按位与? 它给出的错误是“'CString' 没有定义此运算符或转换为预定义运算符可接受的类型”
【问题讨论】:
标签: visual-c++ mfc