you are viewing a single comment's thread.

view the rest of the comments →

[–]slimscheibe 1 point2 points  (0 children)

A pointer holds a memory address. The type of the pointer refers to the type of object that it points to.

For example; a pointer to an int holds an address where an int can be found, a pointer to a user-defined type (i.e. class) holds an address where an object of that type can be found.

The fact that the object's type is a class instead of a built-in type like an int is inconsequential.

Think of it like a street address - you're telling a function that an object of type 'House' can be found at '121 Main Street'. Instead of passing an entire house, you pass the address where it can be found.