reference class parent's function

okibi okibi at ratedo.com
Mon Apr 30 04:57:18 PDT 2007


Hello!

I was wondering if you could tell me how to reference a class's function from another class after the first class has created an instance of the second class. Take a look at this:

class1 {
  class2 c2 = new class2();
  public void writeFunc(char[] myStr) {
    writef("%s", myStr);
  }
}

class2 {
 ???.writeFunc("hello world"); 
}

Any ideas?

Thanks!


More information about the Digitalmars-d-learn mailing list