Postion of & or * to denote reference type or pointer
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
20:13 UTC
Read the original article
Hit count: 320
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;
int *x;
or
int& x;
int* x;
© Stack Overflow or respective owner