Basic C++ question about pointers/structures
In the book that I am using they use two notations for calling structure data members when using pointers.
(*pt).payRate * (*pt).hours ;
(pt ->payRate * pt ->hours);
I understand that in the first line * is dereferencing the pointer so that I can retrieve the data in the address stored in the pointer variable.
I know the second line gives me the same answer as the first but not sure how. Is the second line a short cut, or is it retrieving data differently than the first line?
Thanks in advance.
(*pt).payRate * (*pt).hours ;
(pt ->payRate * pt ->hours);
I understand that in the first line * is dereferencing the pointer so that I can retrieve the data in the address stored in the pointer variable.
I know the second line gives me the same answer as the first but not sure how. Is the second line a short cut, or is it retrieving data differently than the first line?
Thanks in advance.
0