this is an assignment homework
I have defined a structure X....
struct X{
string name;
char grade;
};
here are the questions
a) Declare r as a variable of X, s as a pointer variable to X and w as a pointer variable to a pointer of X.
X r, *s, **w;
...just hope anyone would help on this
my answers to other parts would depend on the above answer...
b)assign a newly created dynamic array of 99999 pointers of X to w.
w=new &&X[99999];
c)assign the address of r to the last entry of w.
w[99998]=&r;
d)assign " Chan Tai Man" to the name of the structure pointed by w[5]
w[5]->name="Chan Tai Man"
e)swap the values of the first two entries of w, using s as a temporary store.
s = w[0];
w[0]=w[1];
w[1]=s;
f) release the dynamic array to the freestore of the OS
delete []w;