Outputting arrays to a textfile

closed account (GbX36Up4)
http://pastebin.com/Kb23QuiN

Basically I need my program to output 25 arrays to a textfile. A few notes are that this is not complete as I still need to get it workign right. I also understand that there are a million better ways to write this but I just need a solution as this has been giving me problems for several hours now. Currently the output is just 24, and it should not be that at all. I can give more code if needed but I am hoping the error is something simple here I cannot see. Thanks.
Your code is:
1
2
3
for(int loopa = 1;loopa < 25;++loopa){
//junk
}

Lets size it down by saying for(int loopa = 1;loopa < 3;++loopa)
1. loop = 1 - still smaller than 3, loop continues.
2. loop = 2 - still smaller than 3, loop continues.
3. loop = 3 - not smaller than 3, done loop is ended.

closed account (GbX36Up4)
I'm sorry, but I still don't see my problem. I can see that you're telling me it is the loop but I don't see what is going wrong.
Change the condition to <=
for(int loopa = 1;loopa <= 25;++loopa)
closed account (GbX36Up4)
It still does not work. Maybe you guys should see the whole program? The only thing is that it is over 500 lines and will probably be hard to read.
Im thinking loopa may be 0 to 24 inclusive so either try changing the for loop to
for(int loopa = 0;loopa < 25;++loopa) and adjusting the if's to start from zero, or increment loopa before the for loop.

If that doesn't work upload all the code.
Last edited on
closed account (GbX36Up4)
I'll try out your suggestions. Here is the full program if you want to take a look.
http://pastebin.com/WuEmcqp1
closed account (GbX36Up4)
I hate to say that none of your suggestions worked.
Debug your program and post what you get.
closed account (GbX36Up4)
I was using Dev-cpp so I downloaded wxdev and when the program opens it says "Editor.exe has crashed". I ran the debugger and this is what I get:

.drectve `-aligncomm:"___hexdig_D2A",5' unrecognized
.drectve `-aligncomm:"___hexdig_D2A",5' unrecognized
Last edited on
closed account (GbX36Up4)
Going to find a better way to do this. Don't bother to continue looking.
Topic archived. No new replies allowed.