Okay, I figured out the larger problem that I've been having with my program, now all I need is it to get out of the loop and finish the program. Well, it won't break out for some reason. Anyone see why?

row = col = 4;
z = 0;
    do { array[x][y].replace = '?';
         print (array, mark, col, row);
         ask (a, x, y, z, array, row, col, count); 
         if (x == row-1 && y == col-1) break;
    while (z == 0);

x and y are incremented in ask() and returned. So I figured if x == 3 && y == 3 , it should break from the do while loop and that would be fine. The problem is that when it returns from ask(), hits my if, and then says that the program has stopped working and needs to close.

What am I missing?

8 Years
Discussion Span
Last Post by DemonGal711

and then says that the program has stopped working and needs to close

Who says that? Where's the message text? Is it OS message? If so - as usually the memory is corrupted before this point.
Obviously the problem is not in this relatively simple (but questionable - for example, why if-break is not a part of do-while condition?) loop. Do you think that we all know where is your previous posts with your sources?


Well, I had messed with my statement a bunch of times, the original was a while where what I had in the if was stopping it.

The problem was a statement after the while was messing it up, I just forgot I had put it in there (cause all the messing with my code I had hit backspace and latched it to the end of the while end bracket. That's what was causing the error, not my while.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.