1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of dereference

By , About.com Guide

Definition: In C and C++, dereference applies to a pointer and means to access the variable or memory location that the pointer points to.
int a=9;
int * ptra = &a;
*ptra= 10;
printf("Value of a is %i",a) ;
In this example, the pointer ptra is set to point to a. *ptra derefences the ptra variable and sets the value to 10. This is the same as saying a=10;

References automatically dereference without needing an extra character.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Explore C / C++ / C#
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.