Joined
·
8,320 Posts
I tried to search the web but I am kinda having difficulty in finding some "basic" difference between these two in layman terms.
POINTER:
int A;
int *pA;
pA = &A;
REFERENCE:
int A;
int &rA = A;
So what?
A is the name of the address of 2 bytes reserved in memory for integer type.
pA is the pointer which contains the address of A.
So what would rA be?
POINTER:
int A;
int *pA;
pA = &A;
REFERENCE:
int A;
int &rA = A;
So what?
A is the name of the address of 2 bytes reserved in memory for integer type.
pA is the pointer which contains the address of A.
So what would rA be?