[Vala] Is this the right syntax for defining pointers in Vala ?



Is this the right syntax for defining pointers in Vala ?

//------
using Posix;

void main (string[] argv) {
    string a = "hello";
    var b = &a;
    strcpy(*b, "bye");
    Posix.stdout.printf("a = %s\n", a);
    Posix.stdout.printf("b = %s\n", *b);
}
//-----

If not, how does one declare that a and b point to the same object in Vala ?


Serge.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]