Multiplying Numbers Using Pointers

Pointers to multiply numbers

The pseudocode statement for multiplication is as follows:

[x1] <- [x1] * [x0]

This statement means that we multiply the contents of the memory cell whose address is stored in the x1 register by the value stored in the memory cell whose address is in the x0 register.

In the C/C++ language

In C or C++, we write a similar expression as that for the addition operation

Note: We have two distinct meanings of the * operator—one for the pointer dereference and the second for multiplication.

Get hands-on with 1200+ tech skills courses.