Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
C++ vector
i have this vector
example.push_back("tab"); //Add tab onto the vector
example.push_back("tab\n"); //Add tab to the end
example.push_back("33\n"); //Add 33 to the end
for(int x=0; x<example.size(); x++)
{
cout<<example[x]<<" "; //Should output: tab tab 33
}```
but i have few problems. first of all, when i compile it i will get this output:
```markuptab
<thereisaspace>tab
<thereisaspace>33```
and i need it without that space. i dont know what is wrong there.
also, what about if i need to add the another entry, for example called tab2, at before the tab, not at end of vector?
and what about if i want to delete the value 33?
thanks.
cout<<example[x]<<" "; //Should output: tab tab 33
there's a space cuz you told it to put a space there. if you dont want it, say cout<<example[x];
as for the other question, go here: http://www.fredosaurus.com/notes-cpp/stl-containers/vector/header-vector.html