Pointer Question

Hey guys, I have a question as to whether or not I am assigning the following correctly.

The question states:
Assume the declaration

1
2
int m = 35, *intPtr;
double x, *dblPtr;

a) Assign intPtr a value so it points to m
b) Assign dblPtr a value so it points to x, amd then use the pointer to assign x the value of 5.3

On (a), I think it is: intPtr = &m;

On (b), I think it is:
1
2
dblPtr = &x;
*dblPtr = 5.3;
I am questioning myself as to whether I should have used the * operator in assigning the first statements (for instance, *intPtr = &m and *dblPtr = 5.3)

I think I am right on the first set. Can someone please let me know? Thanks
It's correct.
Topic archived. No new replies allowed.