- 1
- 0
- 约7.67千字
- 约 32页
- 2018-03-28 发布于浙江
- 举报
[工学]C程序设计第10章字符串及其操作
#include stdio.h #include string.h #define ARRA_SIZE 80 main() { int n, num; char str[ARRA_SIZE], min[ARRA_SIZE]; printf(Please enter five names:\n); gets(str); strcpy(min, str); for (n=1; n5; n++) { gets(str); if (strcmp(str, min) 0) strcpy(min, str); } printf(The min is:); puts(min); } 本章小结 本章主要介绍了一种特殊的数组——字符串的用法。和一般的数组不同,字符串具有不同的特点。 1)关于定义和初始化字符串 方法有: 使用字符串常量:#define FUN Hello! 使用字符数组: char fun[10] = Hello!; 使用字符指针: char *fun = Hello!; 使用字符串数组: char *fruit[3] = {Apple, pear, orange}; 本章小结 2)使用输入/输出函数。 输入函数主
您可能关注的文档
最近下载
- 2025届高考生物必背的85个重要知识点总结.docx VIP
- 高考必背的85个重要生物知识点总结.docx VIP
- 中国文化概况A-Glimpse-of-Chinese-Culture(修订版)Chapter-8.ppt VIP
- 2026年高考生物必背85个重要知识点总结汇编.pdf VIP
- 预防高处坠落事故专项施工方案.docx VIP
- AutoCAD2022实用教程全套完整教学课件.pptx
- Soundcraft声艺Signature 22MTK Outline Dimensions file)说明书用户手册.pdf
- 教案课件-典五典范英语5a l6教学参考.pdf VIP
- 商业银行数字化转型:文献综述与研究展望_刘敏楼.pdf VIP
- 施工现场临时用电配电箱标准化图集.pdf VIP
原创力文档

文档评论(0)