【发布时间】:2016-05-16 04:28:34
【问题描述】:
我有这段代码:
#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'无法解析”。另外,strcpy 和strlen 等其他关于字符串操作的函数也无法解析。既然我已经这样做了
#include <string>
我不知道为什么会这样?
【问题讨论】:
-
那些函数属于
<cstring>。 -
不要使用
std::endl,除非你需要它的额外功能。'\n'开始新的一行。