【发布时间】:2018-01-06 12:03:03
【问题描述】:
这是我的代码。这段代码可以运行良好。 但是当我在“cout This is what I get when delete endl
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char * name;
char * n = "aaaa";
strcpy(name, n);
cout << name;
cout << "Hello world!" << endl;
return 0;
}
以下是删除endl的代码
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char * name;
char * n = "aaaa";
strcpy(name, n);
cout << name;
cout << "Hello world!";
return 0;
}
【问题讨论】:
-
请在您的帖子中复制/粘贴错误消息,而不是提供图片链接
-
也许读过
strcpyreference?
标签: c++