皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【单选题】
【 10.6 】下面程序的功能是用 字符指针变量 作函数参数编程实现字符串连接函数 strcat() 的功能,将字符串 srcStr 连接到字符串 dstStr 的 尾部 。程序的运行结果如下: Please enter the source string: abcd ↙ Please enter the other string: efgh ↙ The concat is: abcdefgh 按要求在下面程序的空白处填写适当的表达式或语句,使程序完整并符合题目要求。 1. #include 2. void MyStrcat(char *dstStr, char *srcStr); 3. int main() 4. { 5. char s[80]; // 源字符串 6. char t[80]; // 待连接字符串 7. printf("Please enter the source string: \n"); 8. gets(s); 9. printf("Please enter the other string: "); 10. gets(t); // 输入字符串 11. MyStrcat(s, t); // 将字符数组 t 中的字符串连到 s 的尾部 12. printf("The concat is:\n"); 13. puts(s); // 输出连接后的字符串 s 14. return 0; 15. } 16. 17. void MyStrcat(char *dstStr, char *srcStr) // 用字符指针作为函数参数 18. { 19. while (__________) 20. { 21. dstStr++; 22. } 23. while (*srcStr != '\0') // 若 srcStr 所指字符不是字符串结束标志 24. { 25. _________; // 将 srcStr 所指字符复制到 dstStr 所指的存储单元中 26. srcStr++; // 使 srcStr 指向下一个字符 27. dstStr++; // 使 dstStr 指向下一个存储单元 28. } 29. _____________; // 在字符串 dstStr 的末尾添加一个字符串结束标志 30. }
A.
第 19 行: dstStr != '\0' 第 25 行: dstStr =  srcStr 第 29 行: *dstStr = '\0'
B.
第 19 行: *dstStr != '\0' 第 25 行: *dstStr = * srcStr 第 29 行: *dstStr = '\0'
C.
第 19 行: *dstStr == '\0' 第 25 行: *dstStr = * srcStr 第 29 行: *dstStr = '\n'
D.
第 19 行: dstStr == '\0' 第 25 行: dstStr =  srcStr 第 29 行: *dstStr = '\n'
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】化学风化作用在下列哪种气候条件下进行得最快( )。
A.
干燥
B.
寒冷
C.
温暖
D.
湿热
【单选题】—I don't think people will use money.  Everything will be free. —Well, _________. [     ]
A.
I agree
B.
I don't
C.
I will
D.
I won't
【单选题】I don't think people should keep pets, because animals are happier____.
A.
free from
B.
rich in
C.
in the wild
D.
contain
E.
luxury
【判断题】出于过失,虽然看到警示标识但轻信自己能够避免,高度危险活动区域或者高度危险物存放区域的管理人可以减轻或者不承担责任。
A.
正确
B.
错误
【单选题】I don't think people should keep pets, because animals are happier ________
A.
in the nature
B.
in the wild
C.
in the water
D.
in the forest
【简答题】Complete the sentences with the following words or expressions: luxury free from rich in in the wild contain Fruit and vegetables are vitamins. Sara's parents have a lot of money .She i...
【单选题】出入无人值守的电梯时,陪同者应
A.
先进、先出
B.
先进、后出
C.
后进、先出
D.
后进、后出
E.
:B
F.
.遵守交通礼仪是个人的礼仪修养规范,也是交通安全的根本保障,下列说法不正确的是
G.
行路的基本礼则是前为尊、后为卑
H.
行路的基本礼则是左为大、右为小
I.
三人同行时,中央为尊
J.
行走时要相互体谅,礼让三分
【简答题】Change these sentences into passive voice. Don’t laugh at people because of their mistakes. I don't think people should be ____________ because of their mistakes. 2. Don’t sneer at people because of t...
【单选题】化学风化作用在下列哪种气候条件下进行得最快( )。
A.
寒冷
B.
湿热
C.
温暖
D.
干燥
【单选题】出入无人值守的电梯时,陪同者应
A.
先进、先出
B.
先进、后出
C.
后进、先出
D.
后进、后出
E.
不进不出
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题