+ 1

Cam someone clearly explain why 'int &x' takes the value of a not 'int x'

https://code.sololearn.com/cIeExSgmWR8j/?ref=app

9th Mar 2018, 8:46 AM
Neeraj Jadhav
Neeraj Jadhav - avatar
2 Antworten
0
The ampersand is essentially the memory 'address of' the value.
9th Mar 2018, 9:11 AM
Kerrash
Kerrash - avatar
0
what do you mean?! u r passing ' a ' into the 'swap' method as the first argument ('int &x')
9th Mar 2018, 9:14 AM
Farshaad Heydari
Farshaad Heydari - avatar