I have a question to scopes of vectors.
Suppose I declare a vector (without initializing) at the beginning of main().
Now I enter a block, say a loop. I calculate values and add them to the vector with push_back().The block ends.
Now, outside of the block, will the vector still contain these elements?
Defining the vector inside the opening { of "main" has scope until the ending } of "main".
Any other blocks you use in "main" will still be able to see the vector. The only time this would be a problem is when you call a function outside of "main". Then you would have to pass the vector to that function.