I have seen something in this form:
void function( A_struct &var ) {
var.field0 = 0;
// ...
}
Since there is &
before var
, I thought that var
is a pointer. But in the body, instead of writing var->field0
, var.field0
is written. So, my questions are:
Isn't
var
a pointer?What is the difference between writing
A_struct &var
andA_struct *var
in function parameter?