Previous Page
Declare 'view pointer' variable of an object.
[code screenshot]

Source code for objects 'Robot' and 'Positronic_Brain', which live in namespace 'abc'.
[code screenshot]

Valid uses of a 'view pointer'.
[code screenshot]

Why all these restrictions?
  1. Why would a "view pointer" need to refer to a "pointer"?  Just use the "pointer" variable, even when passing as argument that accepts a "view pointer" variable.
  2. A "local view pointer", has no reason to refer to a formal parameter, as you can just use the formal parameter variable.
  3. Basically, a lot of these restrictions are based on forced code simplicity.
  4. The whole purpose of the "view pointer", is to have a pointer that you know does NOT "own" the memory it refers to.  For example, this allows an object which has a "pointer" variable (which owns it's memory) to be able to return it from one of it's methods (as a "view pointer"), and the variable on the receiving end of the method call knows they don't own the memory.