I'm trying to use pass by reference in C so that the function can modify the values of the parameters passed to it. This is the function signature:
int locate(char *name, int &s, int &i)
However when I try to compile it I get this error that refers specifically to the above line:
error: expected ‘;’, ‘,’ or ‘)’ before '&' token
If I remove the '&' the program will compile, but it will not function correctly, obviously. What's wrong here? How can I make call by reference work?