gets 是从标准输入中读入一行,puts是把字符串输出到标准输出。
1 2 3 4 5 6 | 字符串的输入 scanf gets 字符串的输出 printf puts 字符串的长度 strlen 字符串的复制 a = b 字符串的比较 if (a > b) 字符串的连接 a = a + b |
可以和以前的 getchar 和 putchar 做一下比较
1 2 3 4 5 6 | puts() 函数----输出字符串的函数 gets() 函数----输入字符串的函数 strcmp() 函数----字符串比较函数 strcpy() 函数----字符串复制 strcat() 函数----字符串连接函数 strlen() 函数----测字符串长度的函数 |
类型改变了,使用的函数也发生了变化。