Hi guys , I've a map : map<string,Question> mapQuest;
In which Question is a class defined in this way :
1 2 3 4 5 6 7 8 9 10 11 12 13 14
public:
Question(){};
Question( string id , string text ){
this->id = id ;
this->text = text;
priority = false;
};
// getter and setter
.....
//
private:
string id;
string text;
bool priority;
I would like to make a function that display the text of all the elements of the map, and after , to changing the value of priority to true.
I tried something like this, but it doesn't work:
1 2 3 4 5 6 7 8
map<string,Question>::iterator it ;
for ( it = mapQuest.begin() ; it != mapQuest.end() ; ++it ){
cout<< it->getText()<<endl;
it->setPriority(true);
}