【发布时间】:2012-08-17 21:07:18
【问题描述】:
为什么 if 语句总是正确的?
char dot[] = ".";
char twoDots[] = "..";
cout << "d_name is " << ent->d_name << endl;
if(strcmp(ent->d_name, dot) || strcmp(ent->d_name, twoDots))
我用strcmp 错了吗?
【问题讨论】:
-
简短的回答是肯定的,但你可能想在 C++ 中使用
std::string...