I am wondering how to read a file in c... this requires some more background information before you give me something useless
What I have so far:
#include <stdio.h>
int main(void)
{
FILE *fpr,*fpw;
char C;
int I;
fpr = fopen("cwM.dat","r");
fpw = fopen("echocwM.dat","w");
while (C != EOF)
{
fscanf(fpr,"%c",&C);
fprintf(fpw,"%c",C);
I = C;
printf("%d\n",I);
}
fclose(fpr);fclose(fpw);
return 0;
}
my real question is what if the file I'm trying to read is: ÿdÿ
before you post a solution, check your code against the above file.