O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dereferencing Pointer Variables

So far we've used the address-of operator to find the memory addresses of variables. These values have also been stored in pointer variables. Addresses themselves are not really that interesting, though; in the end we want to work with the actual data stored in memory at those addresses. C provides the dereferencing operator (*) to do just that.

Given a pointer variable that contains an address, the * operator allows you to read and write the value stored at the place in memory whose address is stored in the pointer variable. This process is called dereferencing a pointer.

The dereferenced address can be used wherever the original variable could be. So if x is an integer pointer variable, then *x can be used wherever ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required