Home I can't add item to ( std::vector < std::vector <std::string> > )
Reply: 0

I can't add item to ( std::vector < std::vector <std::string> > )

user865
1#
user865 Published in July 16, 2018, 3:07 am

This question already has an answer here:

  • add an element to an empty vector in c++: why push.back works and [] not 1 answer
  • Loading data into a vector of structures 2 answers

Why can't I add an item to vector :

std::vector < std::vector <std::string> > my_list;
my_list[0][0] = "this is text";

std::cout << "text: " << my_list[0][0] << std::endl;

What am I doing wrong?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.321115 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO