بسم الله الرحمن الرحيم
ممكن تصحيح الكود
وهذا ما يطلبه الكود
(write a program that delete extra space from a text file)
#include<iostream.h>
#include<stdio.h>
#include<string.h>
void main(){
char s[100];
FILE *fp1=fopen("c:\\file1.dat","r");
FILE *fp=NULL;
if((fp=fopen("c:\\file2.dat","w+"))==NULL)
cout<<"error";
else
while(!feof(fp1)
fscanf(fp1,"%s",s);
fprintf(fp2,"%s",s);
}
char c;
fclose(fp1)
fp1=fopen(":\\file1.dat","w");
rewind(fp2);
while(!feof(fp2))
fscanf(fp2"%c","&c")
fprintf(fp2,"%c","c");
}