Why is the fgets function deprecated?
问题 From The GNU C Programming Tutorial: The fgets (\"file get string\") function is similar to the gets function. This function is deprecated -- that means it is obsolete and it is strongly suggested you do not use it -- because it is dangerous. It is dangerous because if the input data contains a null character, you can\'t tell. Don\'t use fgets unless you know the data cannot contain a null. Don\'t use it to read files edited by the user because, if the user inserts a null character, you