Jan 24, 2011 at 4:57pm
pt+1 will print the value of ( address pointed by pt + sizeof(CandyBar) ) which is some location in memory not related to anything in your code.
Jan 24, 2011 at 4:59pm
pt->brand
is how you set that value, so pt->brand
is how you can read that value.
std::cout << pt->brand;
The address of weight, if you really want it, can be found like this:
&(pt->weight)
Last edited on Jan 24, 2011 at 5:04pm
Jan 25, 2011 at 3:40am
I understood.thank you guys !