Postion of & to denote reference type

Posted by Matt H on Stack Overflow See other posts from Stack Overflow or by Matt H
Published on 2010-03-26T19:21:37Z Indexed on 2010/03/26 19:23 UTC
Read the original article Hit count: 123

Filed under:
|
|
|

I was wondering whether to put the ampersand (&) after the variable type or before the variable name. To put it simply, I want to know which one is the conventional style or the standard, or if it is entirely down to preference.

int &x;

or

int& x;

© Stack Overflow or respective owner

Related posts about c++

Related posts about conventions