Programming Concepts: Pointers< A-level Computing | AQA | Problem Solving, Programming, Operating Systems, Databases and Networking | Programming Concepts
Pointers are incredibly important computing concepts as we need pointers to create many of the ADTs (Abstract Data Types) we are going to talk about. Some languages don't allow you to directly manipulate them, but all languages use them. For this section of the book you need to be familiar with the concept of pointers as we'll be using them heavily when we talk about linked lists, queues and stacks.
Quick examples of pointers might include the next free memory location in an array, or the location in memory that an array is stored at.
We are going to deal with two variables:
We are also going to meet two key characters:
int a = 5; int *ptr = NULL;
(The NULL pointer shown here is 0x00000000.) By assigning the address of
ptr = &a;
yields the following memory values:
Then by dereferencing
*ptr = 8;
the computer will take the contents of
storing next free memory addresses. Used to create abstract data types.