exe4.30 error.cpp
来自「C++ primer 4th edition 部分习题解答 前十章」· C++ 代码 · 共 29 行
CPP
29 行
#include<iostream>
#include<string>
#include<vector>
#include<bitset>
#include<math.h>
#include<cstring>
using namespace std;
//error with strcat and can't find why.
int main()
{
char *str1="hello ";
char *str2="world!";
strcat(str1,str1);
//int i=strcmp(str1,str2);
// int len=strlen(str);
// char *strEnd=str+len;
// for (str;str!=strEnd;str++)
// {
// cout<<*str;
// }
// while (*str1)
// {
// cout<<*str1;
// }
cout<<str1<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?