is it possible to create array of pointers and set + get its elements using a class like this?. make changes/add to the class as needed. show actual code, if possible.
class t
{
t::t()
{
}
t::~t()
{
free(array);
array = NULL;
}
void set_size(int s)
{
array = new int [s];
}
void set(int n, int x)
{
array[n] = x;
}
int get(int n)
{
return array[n];
}
int *array;
};