Difference between revisions of "Week 3"

From CDOT Wiki
Jump to: navigation, search
(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…')
(No difference)

Revision as of 11:06, 26 May 2010

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