Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ?
- From: "Jonathan Ryan" <jryan curious-computing com>
- To: 'Rui Tiago Cação Matos' <tiagomatos gmail com>, "'Serge Hulne'" <serge hulne gmail com>
- Cc: 'vala-list' <vala-list gnome org>
- Subject: Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ?
- Date: Mon, 20 Jun 2011 19:29:55 -0400
Also remember that "[t]he data type for strings is string. Vala strings are UTF-8 encoded and immutable."
[http://live.gnome.org/Vala/Tutorial#Strings]
If they are to be immutable, assigning strings must yield shallow copies.
-----Original Message-----
From: vala-list-bounces gnome org [mailto:vala-list-bounces gnome org] On Behalf Of Rui Tiago Cação Matos
Sent: Monday, June 20, 2011 6:03 PM
To: Serge Hulne
Cc: vala-list
Subject: Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ?
On 20 June 2011 22:26, Serge Hulne <serge hulne gmail com> wrote:
///
using Posix;
void main (string[] argv) {
string a = "hello";
string b = a;
Posix.stdout.printf("a = %p\n", &a);
Posix.stdout.printf("b = %p\n", &b);
This is printing the address where the pointers are, that's why you are getting 2 different stack addresses.
Remove the '&' here and it will actually print their values.
}
///
Rui
_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]