KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This code: int a = 5; int& b = a; b = 7; cout << a; prints out 7, and replacing int& b with int &b also prints out 7. In fact so does int&b and int & b . I tested this kind of behavior with a simple class as well. In general, does it ever matter whether the ampersand is placed relative to the type and identifier? Thanks.
Tags (comma-separated)
Save Edits
Cancel