This is not C but C++, PointList &L, I am used to writing it as PointList& L, which declares a reference type. If the function parameter is not a reference type, a copy will be made. If it is a reference type, the original structure value will be passed.
In short, PointList L passes the value and PointList &L passes the address.
For non-primitive types, please always use PointList &L as formal parameters. If you do not want to change the actual parameters, please use const PointList &L.
This is not C but C++,
PointList &L
, I am used to writing it asPointList& L
, which declares a reference type. If the function parameter is not a reference type, a copy will be made. If it is a reference type, the original structure value will be passed.In short,
PointList L
passes the value andPointList &L
passes the address.For non-primitive types, please always use
PointList &L
as formal parameters. If you do not want to change the actual parameters, please useconst PointList &L
.