我在检查 0 时遇到问题,我试图从文件中获取数字(我明白了)但如果是 0,那么我说>
0 maybe its not found!(0 | 0)
0 maybe its not found!(1 | 1)
0 maybe its not found!(2 | 2)
0 maybe its not found!(3 | 3)
0 maybe its not found!(4 | 4)
如果我想要 1 并且我从行中得到正确的行:
0 maybe its not found!(0 | 0)
[Line0]: 1 1 1 200 150 6 1 10000000 1
[Line1]: 1 1 13 14
0 maybe its not found!(2 | 2)
0 maybe its not found!(3 | 3)
0 maybe its not found!(4 | 4)
检查功能是:
int myClass = 0; //'\0'
for(int i=0; i < Show.line0 && Show.line1; i++)
{
if( Show.Get[i].m_Class0 && Show.Get[i].m_Class1 == myClass )
{
........
}
else
{
cout << myClass; cout << " maybe its not found!";
cout << "(";
cout << Show.Get[i].m_Class0;
cout << " | ";
cout << Show.Get[i].m_Class1;
cout << ")";
cout << endl;
}
m_class0/1 是 int 并且它的值是从加载的文件中获取的。在 myClass 上大于 0 的其他值中,我从文件中获取以想要的数字开头的相同行,但不适用于 0。