The code that you posted is not an infinite loop, although it's possible it's a really long loop if the value if i is very high. |
Yes, that for loop is not an infinite loop, but when I run the code, it never ends so I need to terminate it. The
i values that I work is 5-6 so I don't think it should take this much time. It instantly gives the expected result when I don't use the loop. But if I want this to work with any
i value I know I have to use a loop.
Therefore, you should show more code to let us reproduce the issue. |
What I basically do is; I get values from each line according to input value and store them in a vector.
For example, I get values from
and put each into a vector using push_back(). My vector will have 1,2,3,4,5,6,7,8,9,10 at the end. It is really simple operation, I don't know why that for loop doesn't work.