Especially not on the program's stack, which is usually about a megabyte.
Our friend needs to learn how to A) minimize data structures and B) use malloc() and free().
Type: Posts; User: CommonTater
Especially not on the program's stack, which is usually about a megabyte.
Our friend needs to learn how to A) minimize data structures and B) use malloc() and free().
Hopefully you now appreciate the importance of backups...
And "file opens fine" is NOT a good excuse for writing code with no error checking...
Yep... like this...
FILE *host_freq;
host_freq= fopen("hostfreq.txt", "a");
if (! host_freq)
{ printf("Host Frequency file not opened!")
exit(1); }
Actually with that code, j is initialized to 0 but i is not initialized at all and might contain any random value.
Also there's no check to see if the files actually opened or not...