Original Post
this is sorta a dumb question that i think i should know the answer ...
ok say we have this
class sample
{
int x;
public:
set_x (int a) { x = a; }
get_x () { return x; }
}
now say we want a pointer of this class, and we allocate some memory for it ...
sample *p = new sample;
obviosly to access the class members we go
p -> set_x (100);
then to display this we could just go cout << p -> get_x ();
now say we want to allocate an array and set our pointer to that location so ...
sample *p = new sample [3];
... now here''s what i don''t get when you use this and we want to access it you go ...
p[0].set_x (100) or p[1].set_x (200) ... what happend to the -> opperand ???