标签:
1 #include <stdio.h> 2 #include <string.h> 3 4 int main() 5 { 6 FILE *fp; 7 fp=fopen("c:\\1.txt","r"); 8 char buf[1024]; 9 while((fgets(buf,1024,fp))!=NULL) 10 { 11 int i=strlen(buf); 12 if(buf[i-1]==‘\n‘) 13 { 14 buf[i-1]=‘\0‘; //c风格的字符串 15 } 16 printf("%s",buf); 17 18 }
标签:
原文地址:http://www.cnblogs.com/qingyuanjushi/p/5751733.html