void makeDouble(int* x)
{
*x = 2* *x;
}
* modifies a pointer
This in English is makeDouble takes an integers pointer
Then the integers pointer is modified.
An '&' sign is a pointer. int I, *p; /* means that there is an integer I and an integer memory reference *p;
An expression has a type and value.
*(r=&j) *= *p
**p dereferences p
Pointer to void
- Why do pointers have types?
- So we can dereference them
- So we can dereference them
No comments:
Post a Comment