I am trying to assign a list of values to a vector:
vector<string> words;
words[] = {"one", "two", "three"};
This does not work. How can I accomplish it?
If you have C++11:
vector<string> words = {"one", "two", "three"};
Should work.
Otherwise you'll have to push them all in yourself or use a proxy array.
I need to assign the values after the declaration.
words = {"one", "two", "three"};
does not work.
(use some high-level programming language which supports what humans need to express algorithms. Sorry ;-))