alias for a variable

Hi.
What does it mean that &n is an alias for n?

thanks in advance!
An alias is another name for the exact same thing. I suspect this is really a question about references.

1
2
3
int n; // an int variable
int& p = n; // p is a reference to n. p is not a separate int. It is 
            // another name for the exact same object - an alias. 


&n is an alias for n?
It is not. &n gives a pointer to n; it is the address of n.
Last edited on
Topic archived. No new replies allowed.