#include <stdio.h> #define SIZE 80 char * f_get(char arr[], int n); int main(void) { char input[SIZE]; f_get(input,SIZE); printf("%s\n",input); return 0; } char * f_get(char arr[], int n) { char *p; int i = 0; p = arr; *p = getchar(); while (*p != '\n') { *++p = getchar(); } *++p = '\0'; }
利用getchar()构建fgets()函数
猜你喜欢
转载自www.cnblogs.com/cokefentas/p/12313226.html
今日推荐
周排行