Alt text:
Image that says:
HOLY SHIT!! IS THAT A MOTHERF*CKING C++ REFERENCE???
int& a = b;
You must log in or register to comment.
I’ve used C but never C++. What does it mean for a variable’s type to be
int&
? From when I’ve used it,&
would be used to create a pointer to a variable, but the type of that pointer would beint*
.edit:
never mind, I looked it up. It’s a “reference” instead of a pointer. Similar, but unlike a pointer it doesn’t create a distinct variable in memory of its own.