Week 3

From CDOT Wiki
Revision as of 12:06, 26 May 2010 by Jaburton1 (talk | contribs) (Created page with 'What is a platform? - a combination of a CPU, OS and compiler. What is an address? An unsigned integer (no negative numbers) Why have pointers and not just unsigned ints? Becau…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What is a platform? - a combination of a CPU, OS and compiler.

What is an address? An unsigned integer (no negative numbers)

Why have pointers and not just unsigned ints? Because pointers do not show us what type of variable we are working with. For example, when working with this: unsigned int b = &a; we have no idea what type of variable the address of a is holding.

What is the real difference?

The real difference is that when you add one to a pointer, it doesn't just add one, it adds 4 bytes (it wants to go to the next integer in memory - or 8 bytes for double, etc). Pointer rithmetic