basically I can I access the private map from the constructor but not
from other members :-(
class FAnagramGenerator {
public:
FAnagramGenerator(){
std::string len2[3] = {"blue", "red", "green"};
std::string len3[3] = {"pink", "orange", "white"};
std::string len4[3] = {"black", "yellow", "brown"};
this->list[2] = len2;
this->list[3] = len3;
this->list[4] = len4;
std::cout << this->list[3][1] << std::endl; // Works!!!
};
std::string getAnagram(int size) const{
std::cout << this->list[size][1] << std::endl; // Doesnt!!
return this->list[size][1];
};
private:
std::map<int, std::string*> list;
};
thanks in advance! :-)