The dereference operator or indirection operator, "*" (star), is a unary operator found in C-like languages that include pointer variables. It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address. This is called "dereferencing" the pointer.

PropertyValue
dbpprop:abstract
  • The dereference operator or indirection operator, "*" (star), is a unary operator found in C-like languages that include pointer variables. It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address. This is called "dereferencing" the pointer. The following is an example: int x = 0; int *pointer_to_x = &x; (*pointer_to_x) += 1; //x is now equal to 1 The above C code increments the variable x by using the indirection operator and a pointer to the variable x. Many other operators exist to dereference pointers, and this is of significant importance especially in Object Oriented languages. In Java for example there is the binary operator, "dot," which is placed by infix notation between an object reference on the left and a member of that object's class on the right. In the form X. Y the dot operator dereferences the pointer X, yielding an object, and then accesses the member Y from that object. The following is an example: int a = new int{1, 2, 3}; int c = a. length; The above Java code first creates an array of int primitives, and stores a reference to that array in pointer a. The dot operator is then used to dereference the pointer a and access the length member of the array object, storing the value in variable c. The C language star operator can be used in compositions where multiple acts of dereferencing are required. Pointers can of course reference other pointers, and in such cases, multiple applications of the dereference operator are needed. Similarly, the Java dot operator can be used in compositions forming quite sophisticated statements that require substantial dereferencing of pointers behind the scenes during evaluation.
dbpprop:hasPhotoCollection
rdfs:comment
  • The dereference operator or indirection operator, "*" (star), is a unary operator found in C-like languages that include pointer variables. It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address. This is called "dereferencing" the pointer.
rdfs:label
  • Dereference operator
owl:sameAs
skos:subject
foaf:page
is dbpprop:redirect of