Searching for an appropriate data structure in C++ to push into vector -


I want the following to be pushed into a vector, which is the data structure suitable for the same: I push I want to:

  (1, 10) (2, 11) (3, 12)   

I know how to make a vector in an integer Push to do but I'm not sure about the list that I have now. I am looking for a data structure which is memory efficient. I know that with a vector I am in this case Using not list me, but that is a memory efficient if no other data structure memory efficient Please suggest.

some structure or std :: pair & lt; Int, int & gt; .

  #include & lt; Utility & gt; / * Std :: pair & lt; T1, T2 & gt; * / ... std :: vector & lt; Std :: pair & lt; Int, int & gt; & Gt; Vec; Vec.push_back (std :: make_pair (1, 10)); Vec.push_back (std :: make_pair (2, 11)); (AutoItter = vec.begin (); iter! = Vec.end (); ++ iter) std :: cout & lt; & Lt; Etar-> First & lt; & Lt; "" & Lt; & Lt; Etar-> Second & lt; & Lt; Std :: endl;    

Comments