The following code
#include #include using namespace std; int main() { vector value; cout << value.
value.size() returns an unsigned type, so by doing -1 you are actually doing an overflow