C++ Pointers

Reference operator ( & )

andy = 25;
fred = andy;
ted = &andy;

Dereference operator (*)

beth = *ted;

Declaring variables of pointer types

type * name;

2 Responses to “C++ Pointers”


  1. 1 Bennett October 15, 2008 at 5:55 pm

    Hi,

    Can U Tell me How Pointers Rule Applies in C++…

  2. 2 silencer22 October 25, 2008 at 7:34 pm

    basically, in c++, it always passes by value of the variable..
    unless you want a pointer, you hav to make use of prefix & to the variable name. to accept the pointer, the variable has to be declared with * prefixed. If you are referencing a pointer, using the variable directly only gives u the address. To get a actual value from the pointer, prefix with * to return the exact value of that variable


Leave a Reply