digitalmars.D - Append char to char-array in function
- Nrgyzer (22/22) Mar 21 2010 Hello everyone,
 
Hello everyone,
how can I add a char to a char-array by using a other class?
For example:
class A {
   private char[] text;
   this() {
   ...
      text ~= "a";
      new B(text);
      writefln(text);
   ...
   }
}
class B {
   this(char[] text) {
   ...
      text ~= "b";
   ...
   }
}
This should write "ab" in the command line, but only "a" is shown.
... Thanks for help :).
 Mar 21 2010








 
 
 
 Nrgyzer <nrgyzer gmail.com>