Re: [Vala] Is this the right syntax for defining pointers in Vala ?
- From: Luca Bruno <lethalman88 gmail com>
- To: Serge Hulne <serge hulne gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Is this the right syntax for defining pointers in Vala ?
- Date: Mon, 20 Jun 2011 21:20:05 +0200
On Mon, Jun 20, 2011 at 08:38:29PM +0200, Serge Hulne wrote:
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 ?
Maybe you're looking for unowned string b = a;
Pointers are with * anyway.
--
http://www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]