Hello all,
Does anyone know how to read a file, one character at the time, into an character array? No matter what I try I cant seem to get it to work.
Edit:
The size of the file is unknown...it will be different each time the program is run, and it could end up being very large.
My main problem is putting the characters in an array when I don't know how many elements to define for the array.
Here is the basic code i have:
}Code:int count; char *key="something here"; FILE *in; if (( in = fopen("tmp.tmp", "rb")) == NULL) { printf("Error opening %s.n", ""); } while(( count = getc(in)) != EOF) { count = count ^ *key; //store here }