I am not sure how to initialize a map and a dynamically allocated array members of a class in the default constructor. Is there a standard way of doing this? Like, should I initialize the map/dynamically allocated array to 0's or should I not even initialize them at all ?
My could would look something like this:
class A{
public:
map<string, int> mapA;
int* intArray;
}
A::A(){
map<string, int> mapA;
intArray = new int[30];
}
But I am finding all sort of troubles when working with this class. What would be the correct way of solving this problem?
Thanks for your help!