References (Pointers) - The Good and the Bad
• The word reference is the official, technical
term and it applies to computer languages
in general.
• Pointer means the same thing, but it is a
sort of slang, just for C (and C++). From
now on, I will usually use the word pointer.
• Pointers are a very powerful part of the
language. With them you can:
• Pointers are a very powerful part of the
language. With them you can:
– Get an unlimited number of results from a
function.
– Pass arrays and structures into and out of
functions with no problems.
– Embed structures and arrays inside of other
structures and arrays.
– Create arrays whose size you don't know until
the program runs.
• Pointers are also the most difficult part of
the language. With them you can:
– Become extremely confused.
– Create horrible bugs that are hard to find.
– Crash your own (or someone else's) system.