G
Guest
Hello
Thank for reviewing this question. I would like to know why I am getting a syntax error. For example
public class
public class B : public
Init(ref A
B b=new B()
Init(ref b); // compiler erro
Init(b); // leave off both "ref" and it compiles fine
if I have a function that takes a reference to class A, why can't I pass in a reference to class B since it is derived from class A. If I leave off the "ref", it works, but I want a reference instead
Many Thank
Pete
Thank for reviewing this question. I would like to know why I am getting a syntax error. For example
public class
public class B : public
Init(ref A
B b=new B()
Init(ref b); // compiler erro
Init(b); // leave off both "ref" and it compiles fine
if I have a function that takes a reference to class A, why can't I pass in a reference to class B since it is derived from class A. If I leave off the "ref", it works, but I want a reference instead
Many Thank
Pete