C++ 在我的eclipsec++;ide,为什么可以';与字符串相关的函数是否可以解析?

C++ 在我的eclipsec++;ide,为什么可以';与字符串相关的函数是否可以解析?,c++,eclipse,string,ubuntu,C++,Eclipse,String,Ubuntu,我有一段代码: #include <iostream> #include <string> int main() { std::cout << "!!!Hello World " << std::endl; std::string a = "aa"; std::string b; b = "bb"; std::string c = strcat(a,b); std::cout << c

我有一段代码:

#include <iostream>
#include <string>

int main() {
    std::cout << "!!!Hello World " << std::endl;
    std::string a = "aa";
    std::string b;
    b = "bb";
    std::string c = strcat(a,b);
    std::cout << c << std::endl;
    return 0;
}

我不知道为什么会这样

strcat
是一个在
char*
上工作的C函数。您需要
#包含

无论如何,您所做的都是错误的:您没有将
std:string
参数传递给
strcat


使用
c=a+b

那些函数属于
。不要使用
std::endl
,除非你需要额外的东西<代码>“\n”
开始新行。
#include <string>