|
What do you mean crashed, did it compile, or hang when you tried to run it?
Why are you opening 2 files?
The way that would run is to continue grabbing chars from the file until the 100th character or EOF, is that what you want? It could lead to the second while{} loop never being executed.
Why are you not assigning an initial value to index?
And finally. C allocates arrays like so, if you define an array:
char array1[10];
the first element would be array1[0] and the last array1[9]
Even if you had gotten all the other things right, this would be a fatal flaw in the logic, causing a buffer overflow, and while it might still run, it would overwrite another piece of data that may be important.
__________________
_____
NuKeS
|