摘要
针对在C语言课程中学生从文件中读取数据时经常出错的现象,分析FILE结构体的意义和从文件中读取数据的工作机制。然后结合具体程序,指出在应用feof函数判断文件结束时的错误,并分析feof函数的工作机制,提出一种正确使用feof函数进行文件读取的方法。
Focuses on the phenomenon that problem has happened when students read data from file using C language. Analyzes the importance of the FILE struct, and analyzes the process of reading data from file in C. According to some specific examples, points out the mistakes of using feof function to judge the end of reading data. Points out the process of judging end of file with feof function. At last proposes a way that how to correctly use the feof function to read data from file.
出处
《现代计算机》
2015年第7期53-55,77,共4页
Modern Computer