【发布时间】:2021-12-24 08:04:51
【问题描述】:
学习 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
对编译器来说还是新手,所有人都是平等的......所以我对出了什么问题有点困惑。
【问题讨论】:
-
C 实际上是与 C++ 不同的语言,尽管它们有共同的起源和许多相似之处。
-
"Tiny C" 是 C 编译器,而不是 C++。不同的语言。
-
我很确定如果 Tiny C 编译器支持 C++,它就不再是 tiny了。
-
我知道 C 和 C++ 就像 Car 和 Carpet。但是,我跳到假设微型 CC 既适用于 C 又适用于 C++。我的错。哎呀。
标签: c++ string compiler-errors