when a empty vector is created and the following operation is done i am getting wrong answer.
vector.size() -
enter code here
1 on empty vector its returns 4294967295 but the answer is -1
#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> v;
cout<<v.size()<<"\n";
cout<<v.size() -1 <<"\n";
}
the expected output should be
0
-1
but what i am getting was
0
4294967295
i don't know what is going wrong, can anyone tell whats wrong and pls correct it
Aucun commentaire:
Enregistrer un commentaire