indirection definition programming
Manipulating data via its address. Indirection is a powerful and general programming technique. It can be used for example to process data stored in a sequence of consecutive memory locations by maintaining a pointer
to the current item and incrementing it to point to the next item.
Indirection is supported at the machine language
level by indirect addressing
. Many processor and operating system
architectures use vectors
which are also an instance of indirection, being locations which hold the address of a routine to handle a particular event. The event handler can be changed simply by pointing the vector at a new piece of code. C
includes operators "&" which returns the address of a variable
and its inverse "*" which returns the variable at a given address.