Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Complete Pointer Basics

Share this post!
 Vote this!

This document introduces the basics of pointers as they work in several computer languages -- C, C++, Java, and Pascal. This document is the companion document for the Pointer Fun with Binky digital video, or it may be used by itself.
  • Section 1 -- The three basic rules of pointers
  • Section 2 -- A simple code example (the same example used in the video)
  • Section 3 -- Study questions with solutions

Section 1 -- Pointer Rules

One of the nice things about pointers is that the rules which govern how they work are pretty simple. The rules can be layered together to get complex results, but the individual rules remain simple.

1) Pointers and Pointees

A pointer stores a reference to something. Unfortunately there is no fixed term for the thing that the pointer points to, and across different computer languages there is a wide variety of things that pointers point to. We use the term pointee for the thing that the pointer points to, and we stick to the basic properties of the pointer/pointee relationship which are true in all languages. The term "reference" means pretty much the same thing as "pointer" -- "reference" implies a more high-level discussion, more....

0 comments:

Post a Comment