O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

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

29.5. Declaring pointers

Here is an example of how a pointer variable of type int is declared:

int* pInt;

or

int *pInt;

The two statements above are equivalent. A pointer [9] called pInt [10] of type int is declared. If a pointer stores an address (which is a numeric value), what does its type (int) mean? The official term for int in this case is the pointer's 'referent type'. The referent type of a pointer tells the compiler what type is expected at the address which it is storing. Here, we know that pInt stores the address of an int.

[9] The term 'pointer' is synonymous with 'pointer variable'. They are used interchangeably in this book and most other literature.

[10] It is customary to name pointers with a small p in front.

It is important ...

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