Name: Anonymous 2010-03-09 13:21
So I was writing a small program in C. Basically I got some input, did something then wrote in a file. I opened the file in append mode.
So I compile, execute and notice there's a lot of rubbish data in my file. I think maybe there's a memory problem. I recompile reexecute and see the rubbish data and some correct data.
Now for 15 minutes I tried to figure out what was wrong. Then I figured it out. I was never wrong, the program was correct all along I just didn't give correct input the first time so I kept seeing rubbish because the file was in append.
I was enlightened.
So I compile, execute and notice there's a lot of rubbish data in my file. I think maybe there's a memory problem. I recompile reexecute and see the rubbish data and some correct data.
Now for 15 minutes I tried to figure out what was wrong. Then I figured it out. I was never wrong, the program was correct all along I just didn't give correct input the first time so I kept seeing rubbish because the file was in append.
I was enlightened.