Say I want an Array of Pointers to Classes. This is dynamic btw, so the size isnt always set.
Shouldn't i do this???
Code:
CClass** array;
array = new int[someNumber];
for (i=0; i < someNumber; i++)
{
array[i] = new CClass;
}
Well im not completely certain... The second line of code works (well it doesnt seem to) because integers and pointers are both just 32bits in memory.
The error Im getting is on that second line and goes something like this...
error C2440: '=' : cannot convert from 'int *' to 'class CClass ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Thanks for any help, im sure this is just as simple as adding a * somewhere but, well i cant figure out where...