Scope variables.

Justin Whear justin at economicmodeling.com
Mon Oct 7 15:58:09 PDT 2013


On Tue, 08 Oct 2013 00:52:19 +0200, Agustin wrote:
> 
> So i found out that i cannot do this, may i ask why?
> 
> public class A {
>    int x = 0;
> }
> 
> public class B : A {
> }
> 
> void func(ref A a)
> {
> }
> 
> void main()
> {
>    B b = new B();
>    func(b);
> }

Get rid of the "ref" in func's signature--objects are already by 
reference.  With that fix, compiles just fine for me.


More information about the Digitalmars-d-learn mailing list