VitabytesDev@feddit.nl to Programmer Humor@lemmy.mlEnglish · 6 months agoI can see the reference!feddit.nlimagemessage-square5fedilinkarrow-up14arrow-down10file-text
arrow-up14arrow-down1imageI can see the reference!feddit.nlVitabytesDev@feddit.nl to Programmer Humor@lemmy.mlEnglish · 6 months agomessage-square5fedilinkfile-text
minus-squareTheEntity@lemmy.worldlinkfedilinkarrow-up1·6 months agoAn int& reference is just as much of a variable as int* const would be (a const pointer to a non-const int). “Variable” might be a misnomer here, but it takes just as much memory as any other pointer.
An
int&
reference is just as much of a variable asint* const
would be (a const pointer to a non-const int). “Variable” might be a misnomer here, but it takes just as much memory as any other pointer.