Design a site like this with
Get started

Reference vs Pointer


Is a variable that holds memory address of another variable. // int *ptr = &i; Is an alias i.e. another name for an already existing variable. // int &ref = i;
Can point nowhere e.g. NULLMust refer to an object
Can be re-assigned any number of times Cannot be re-assigned after binding
Can take the address of a pointer Can’t take the address of a reference


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at

Up ↑

%d bloggers like this: