dereference


Also found in: Dictionary, Thesaurus, Financial.

dereference

(programming)
To access the thing to which a pointer points, i.e. to follow the pointer. E.g. in C, the declarations

int i; int *p = &i;

declare i as an integer and p as a pointer to integer. p is initialised to point at i ("&i" is the address of i - the inverse of "*"). The expression *p dereferences p to yield i as an lvalue, i.e. something which can appear either on the left of an assignment or anywhere an integer expression is valid. Thus

*p = 17;

would set i to 17. *p++ is not the same as i++ however since it is parsed as *(p++), i.e. increment p (which would be an invalid thing to do if it was pointing to a single int, as in this example) then dereference p's old value.

The C operator "->" also dereferences its left hand argument which is assumed to point to a structure or union of which the right hand argument is a member.

At first sight the word "dereference" might be thought to mean "to cause to stop referring" but its meaning is well established in jargon.

dereference

To go to an address before performing the operation. For example, in C programming, a dereferenced variable is a pointer to the variable, not the variable itself. The expression int Num; declares an integer variable named "Num." The expression *pNum = &Num; places the address of the variable Num (not its contents) into the pointer. The ampersand is the "address of" operator.

Another example is found in the tar archiving program. The dereference switch causes files referenced by symbolic links to be archived rather than the symbolic link itself. The term always refers to "following the link" in order to obtain the intended resource. See symbolic link.
References in periodicals archive ?
There will not be any read exceptions when dereferencing pStruct because all of the addresses to be dereference are the address of self-referential list, which let the program continue to execute until retn.
This paper introduces new techniques for frequent statement and dereference elimination for imperative and object-oriented distributed programs running on hierarchical memories.
Extending the interesting object names by one dereference is necessary to compute the aliases of *p given p=q, since the aliases of *q must be known.
In this case we would need access to both prior context and the ability to dereference an indexical.
3-4: A pointer dereference may refer to the same location as a qualified or subscripted expression only if their types are compatible and the program may take the address of the qualified or subscripted expression.
In general, when a reference is assigned, we do not know which agents will dereference the value.
An @ sign on an array, pointer, or structure dereference identifies a static load.
Then the reference to this variable in an expression is replaced with the dereference expression of that pointer, as illustrated in Figure 1, Column 4.
ObjectStore was designed to provide a unified programmatic interface to both persistently allocated data (i.e., data that lives beyond the execution of an application program) and transiently allocated data (i.e., data that does not survice beyond an application's execution), with object-access speed for persistent data usually equal to that of an in-memory dereference of a pointer to transient data.
An exception must be thrown for any attempt to dereference a null pointer or perform an out-of-bounds array access [Gosling et al.
Even when all arguments are found to be strict, TIM and the STG machine make a function call to obtain the tag of a constructor term (this is the reason why they are called "tagless"), whereas our implementation only needs to dereference a pointer.
An access path is the 1-value of an expression that is constructed from variables, pointer dereference operators, and structure field selection operators.