I'm try to make a For loop inside a do while loop that varies its (the For's) parameters depending on user input within the while loop. The thing is that it works, but it crashes once the programs finishes. Here's the code:
Basically, Function() prints a std::map with its iterator changing, indirectly, depending on the loop variable "i". I've been playing around with the code a bit, and it works when instead of variables in1 and in2 they are fixed numbers. But when replaced with variables, the program runs, it prints the map and then crashes. The error report comes from windows, its the one that goes "'program.exe' has encountered a problem and needs to close. Sorry for the inconvenience." I'm sure I'm doing something I'm not supposed to. Any help is much appreciated.Code:do { for (i = in1; i <in2; ++i) { Function();} if (condition=answer1) { in1+=10; in2+=10;} else if (condition=answer2) { loop=false;} } while (loop=true);