scanf不安全,fgets安全

fgets函數原形 #include<stdio.h> char *fgets(char *s, int size, FILE *stream);web fgets函數從stream指向的文件輸入緩衝區(stdin指向鍵盤輸入緩衝區)中獲取字符串並只獲取size-1個字符串,輸入到s指向的位置中。輸入n(n<size)個字符,從n+1到size位置的全部字符所有自動設爲’\n’結束符;當n=siz
相關文章
相關標籤/搜索