FILE *stream;
if( (stream = fopen( "d;\\data.txt", "r" )) != NULL )
{
FILE *file;
if((file = fopen( "d:\\data2.txt","wb")) != NULL)
{
while (!feof(stream))
{
char *ch = fgets( line, 1024, stream );//读一行
if (ch == NULL) break;
if (ch[0] == 10)
continue;//指定删除空白行,在此你可以处理你的删除条件
fputs(ch,file);//生成data2.txt(data.txt没改动)
}
fclose( file );
}
fclose( stream );
}
if( (stream = fopen( "d;\\data.txt", "r" )) != NULL )
{
FILE *file;
if((file = fopen( "d:\\data2.txt","wb")) != NULL)
{
while (!feof(stream))
{
char *ch = fgets( line, 1024, stream );//读一行
if (ch == NULL) break;
if (ch[0] == 10)
continue;//指定删除空白行,在此你可以处理你的删除条件
fputs(ch,file);//生成data2.txt(data.txt没改动)
}
fclose( file );
}
fclose( stream );
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货