strcatzw.txt

来自「c语言教程源码」· 文本 代码 · 共 33 行

TXT
33
字号
1. // This program is saves as strcatzw.cpp
2. 
3. #include <iostream.h>
4. #include <stdio.h>
5. #include <string.h>
6. #include <stdlib.h>
7. #include <ctype.h>
8. #include <conio.h>
9. 
10. void main(void)
11.  {
12.   char *line;
13.   char text[81];
14.   int line_num = 1;
15. 
16.   cout << "Line number adding is in processing..." << endl;
17. 
18.   while(gets(text) != NULL)
19. 	{
20. 	  line = new char[strlen(text) + 3];
21. 
22. 	  strcat(line, ". ");
23. 	  strcat(line, text);
24. 
25. 	  cout << line << endl;
26. 
27. 	  line_num++;
28. 
29. 	  delete line;
30.   }
31.  }
32. 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?