Answer the question
In order to leave comments, you need to log in
Why does the first element of an uninitialized array point to the last element of the vector created before it?
int main(int argc, char *argv[])
{
vector<int>v4{1,2,3,4};
v4.push_back(889);
array<int,3> arr;
cout<< *(arr.begin()); // 889 . почему?
Answer the question
In order to leave comments, you need to log in
No reason. Accessing an uninitialized variable is undefined behavior, you cannot exploit it in your programs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question