Are these equivalent?

S s;//struct

void f(ref S s){s.x++;}
f(s);

void f2(S* s){(*s).x++;}
f2(&s);

If so, why is it stated that ref is very rarely used?
It looks like something I would use a lot with structures.

Reply via email to