Search⌘ K

More Pointer Types

Explore the concept of different pointer types in C programming. Learn how to handle single pointers, pointers to pointers, and further levels of indirection, enhancing your ability to work with complex memory structures.

We'll cover the following...

Example program

To understand the different types of pointers, see the code given below!

C
# include <stdio.h>
int main( )
{
// Initializes variable i
int i = 10;
// Initializes pointer variables
int *j , **k , ***l, ****m;
// Stores address of i in j
j = &i ;
// Stores address of pointer j in k
k = &j;
// Stores address of pointer to a pointer (k) in l
l = &k;
// Stores address of pointer to a pointer to a pointer (l) in m
m = &l;
return 0 ;
}

Explanation

Line 7: j, k, l, and m ...