- #include<stdio.h>
- int main(){
- FILE *file_fd;
- char buff[8192];
- if ( file_fd = fopen ("1.txt", "r") ) {
- while( fgets (buff, sizeof (buff), file_fd) != NULL ){
- printf("%s",buff);
- }
- fclose (file_fd);
- }
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/140720149969.html
来源: http://www.codesnippet.cn/detail/140720149969.html