Problem passing function argument as reference

guix:
Can someone tell me why the sscanf function (for example) require that we pass referenced parameters with a '&' in front of them, like:

sscanf( str, "%d", val); // doesn't work

sscanf( str, "%d", &val); // work

References didn't exist in C so they had to use pointers.

I think it'd bad form to have your function accept a non-const reference because most things are passed by value so the caller doesn't have to worry about it getting modified and then can't tell when it might be. Adding the & character makes it much clearer that it will be modified.

Passing by const reference is fine so that huge objects don't need to be copied if they won't be changed anyway.