问题描述: 在使用变量std::string时,出现了“变量具有不完整的类型std::string;string.h中有很多错误。”的错误。
解决方法:
示例代码:
#include // 或者 #include
#include
int main() {
std::string str = "Hello, World!";
std::cout << str << std::endl;
return 0;
}
示例代码:
#include
#include
using namespace std;
int main() {
string str = "Hello, World!";
cout << str << endl;
return 0;
}
注意:
上一篇:变量计数和跟踪变化