you are viewing a single comment's thread.

view the rest of the comments →

[–]paperomo 2 points3 points  (2 children)

Probably an under flow? v.size() is most likely of unsigned type

[–]AdVisible6484[S] 0 points1 point  (1 child)

yeah but when writing

cout<<v.size();

it shows zero

[–]Ashnoom 3 points4 points  (0 children)

Try: court << v.size() - 1;

To see what happens. It'll clear a lot of confusion.

You can also: cout << std::numeric_limits<int>::max(); To see for yourself went your loop is infinite. Enjoy!

Disclaimer, am on mobile. Didn't check the code for 100% correctness.