I have a program writing to a file, and I have several arrays that hold 100 to 2000 elements each. Everything has gone well so far, but now when I try to simply declare another array of 200 elements, part of the file is not written correctly (it is blank at the top in some places). However, when I declare this new array with only 20 elements, the file writes fine.
What the heck? Why is it doing this? I don't know how I could allocate memory because the arrays are char [] arrays rather than char* arrays, so I can't say
buffer = (char*) malloc (2000);