I want to create an array of pointer objects to my class. Here it comes
myclass.hpp:
class tempclass
{
public:
int a;
map<int,string>m;
};
class myclass
{
public:
tempclass *t;
myclass()
};
myclass.cpp:
myclass::myclass()
{
int b;
cin>>b;
t=new tempclass[b]; // if b =5, i want to create 5 objects of tempclass
// at runtime
//After that i want to access t like t[0]->a=5;
Can any one help me in this how to overcome this problem. I want to access using the index like t[0],t[1] etc. Since the no of objects are passed at run time i dont know how to handle this.