包含文件 'string' 未找到
include file 'string' not found
学习 C++,第 1 天,第 2 课
我的简单字符串连接测试适用于 online c++ compiler
#include <stdio.h>
#include <string>
#include <iostream>
int main()
{
// Declare and initialize string
std::string mystr = "bananas";
std::cout << "Gwen Stefani is " << mystr << "\n";
return 0;
}
效果很好:Gwen Stefani is bananas
符合预期。但是,使用 Tiny CC 我得到错误:
Error: include file 'string' not found
对于编译器来说仍然是新手,一切都是平等的......所以我对出了什么问题有点困惑。
Tiny CC 是一个 C 编译器,它不支持 C++。
由于<string>
是C++标准头文件,Tiny CC不支持。
学习 C++,第 1 天,第 2 课
我的简单字符串连接测试适用于 online c++ compiler
#include <stdio.h>
#include <string>
#include <iostream>
int main()
{
// Declare and initialize string
std::string mystr = "bananas";
std::cout << "Gwen Stefani is " << mystr << "\n";
return 0;
}
效果很好:Gwen Stefani is bananas
符合预期。但是,使用 Tiny CC 我得到错误:
Error: include file 'string' not found
对于编译器来说仍然是新手,一切都是平等的......所以我对出了什么问题有点困惑。
Tiny CC 是一个 C 编译器,它不支持 C++。
由于<string>
是C++标准头文件,Tiny CC不支持。