Where ampersand "&" can be put when passing argument by reference?
Both are exactly the same. No difference at all.
All that matters is that &
should be between the type and the variable name. Spaces don't matter.
So
void AddOne(int& y);
void AddOne(int &y);
void AddOne(int & y)
void AddOne(int & y);
void AddOne(int&y);
are same!
There is no differences between
void AddOne(int &y);
and
void AddOne(int& y);
and even
void AddOne(int&y);
in C++, as the whitespaces between actual tokens are discarded.
It's the same for the language, just different code conventions