From Cppsyntax
You can get the error
expected identifier before ‘&’ token
in many ways.
Typo in signature
One way is to put the & in the wrong place:
WRONG
void foo(&int bar) // ampersand goes before bar
{
// stuff
}
RIGHT
void foo(int &bar) // the ampersand is in the right place now
{
// stuff
}