int *mem;
is the pointer to the contents ofStaticarray
- You should allocate enough memory to hold the contents e.g.
mem = new int[size];
- remember to delete mem at the destructor of Staticarray e.g.
delete[] mem;
- To access the ith element of a
Staticarray
object calledarr
you would usearr.mem[i];