Skip to main content

C - Pointers

Apointeris a variable which stores the address of another variable.

Unlike other variables that hold values of a certain type, pointer holds the address of a variable.

For example, an integer variable stores an integer value, however an integer pointer holds the address of a integer variable.

The size of the pointer depends on the architecture. However, in 32-bit architecture the size of a pointer is 2 byte; and 64-bit architecuter the size of a pointer is 4 bytes

Declaring a pointer

The pointer in c language can be declared using * (asterisk symbol).

Example:

  1. int*a;//pointer to int
  2. float *c;//pointer to float

Comments