Analytics Vidhya
Published in

Analytics Vidhya

What are pointers in C and how do they work?

A pointer is a data value that references a unit of storage.

Let’s say we want to create some pointers to some blocks of storage that contain integers and the easiest way to to do in the C language would be as follows:

First we must have the following declaration in bold at the top of the .c file:
typedef int *pointerToInteger;

Here is how the .c file should look at this point:#include <stdio.h>
typedef int

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store