Back
Close

Computing with Data

elgeish
576.5K views

References

int a = 2;
int c = 3;
int &refA = a; // refA is a reference to the variable a
int b = refA; // has same effect as b = a

refA = 5; // has same effect as a = 5 

int &refC1 = c;
int &refC2 = c;  // both refC1 and refC2 refer to c
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io