I have class Citizen { string name,address ... } and then I have class TaxRegister.
class TaxRegister
{
public:
bool Add_citizen ( const string& name, const string& addr );
private:
static const int m_Size=1000;
int m_Index,m_IncrementedSize;
Citizen * m_People[m_Size];
};
bool TaxRegister::Add_citizen( const string& name, const string& addr )
{
....
m_People[m_Index++] = new Citizen( name,addr );
}
The problem is, when I have to add more then 1000 people into my array;
I tried to do this:
Citizen *tmp[m_IncrementedSize*=2];
for (int i=0; i < m_Index; i++ )
tmp[i]=m_People[i];
delete [] m_People;
m_People=tmp;
m_IncrementedSize*=2;
But the compilator gives me this:
incompatible types in assignment of ‘CCitizen* [(((sizetype)) + 1)]’ to ‘CCitizen* [1000]’
Does anybody know how to fix it ? Thank you.