...

/

Incrementing Numbers Using Pointers

Incrementing Numbers Using Pointers

Learn how to increment numbers using pointers.

We'll cover the following...

Increment numbers in different environments

In the pseudocode, we can use pointers to increment a number stored at the memory location with the address stored in x0:

[x0] <- [x0] + 1

In the C/C++ language

In C or C++, we can write incrementing numbers using pointers in three possible ways:

*a = *a + 1; // method 1
++(*a); // method 2
(*a)++; // method 3

In the assembly language

In the assembly language, we use instructions ldr ...