this post was submitted on 03 May 2024
1 points (100.0% liked)
Programmer Humor
31808 readers
275 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.