L
lolueec
I'm new to C language and I'm trying to copy and write a text file.
Here is my code - can some one explain why it is not working?
#include <stdio.h>
int main()
{
int x;
FILE *handle1, *handle2;
handle1=fopen("a text file","r+);
handle2=fopen("a text file to write","w+");
while( (x=fgetc(handle1) != EOF){
fputc(x,handle2); // write to the file
}
fclose(handle1);
fclose(handle2);
}
Regards,
Lolu
Here is my code - can some one explain why it is not working?
#include <stdio.h>
int main()
{
int x;
FILE *handle1, *handle2;
handle1=fopen("a text file","r+);
handle2=fopen("a text file to write","w+");
while( (x=fgetc(handle1) != EOF){
fputc(x,handle2); // write to the file
}
fclose(handle1);
fclose(handle2);
}
Regards,
Lolu