First: please use code tags. It makes you code readable.
the following is my code and I am getting an error for this code I compiled it with cygwin and the error is "error while dumping state"
The program compiles fine for me, or do you mean a runtime error? Since I do not have the files, I would guess that:
if (sample == NULL)
You should insert a return 1; here, so the program quits when the file is non-existant.
and: for(i=0;i<=MAX;i++) This line means it will loop from 0 to 44000 which is 44001 times. But your array is only 44000 elemants, so this will cause an memory exception. Change it to: for(i=0;i<MAX;i++) regards Niek