【发布时间】:2014-03-12 15:45:38
【问题描述】:
我正在为班级做作业,但在编译此代码时遇到问题。我在主 .cpp 文件和类 .cpp 文件中都使用了#include <string>。错误是“‘strcmp’不是‘std’的成员”,但无论我使用 std::strcmp() 还是 strcmp(),我都能得到它。
对我做错了什么有什么想法吗?
double temporary::manipulate()
{
if(!std::strcmp(description, "rectangle"))
{
cout << "Strings compare the same." << endl;
return first * second;
}
return -1;
}
【问题讨论】:
标签: c++ class private member strcmp