Apr 6, 2016 07:41 PM
(This post was last modified: Apr 6, 2016 07:42 PM by ShannonL.)
Hey, I have a quick question.
I have a class called "Hashtag" with the private variables
In one of the functions, I declared a vector of type Hashtag...
vector<Hashtag> allTags;
My question is: If I want to set the "string word" variable to "Hello" in the first element of the vector, how do I access "string word" in order to do that?
Is it: allTags.at(i).word = "Hello";
Or am I wrong. Thank you!!
I have a class called "Hashtag" with the private variables
- string word
- int startCount
- More... But the rest don't matter for this question
In one of the functions, I declared a vector of type Hashtag...
vector<Hashtag> allTags;
My question is: If I want to set the "string word" variable to "Hello" in the first element of the vector, how do I access "string word" in order to do that?
Is it: allTags.at(i).word = "Hello";
Or am I wrong. Thank you!!


