Re: [Vala] Can fixed-size arrays be initialized?
- From: Marco Trevisan (Treviño) <mail 3v1n0 net>
- To: vala-list gnome org
- Subject: Re: [Vala] Can fixed-size arrays be initialized?
- Date: Thu, 03 Mar 2011 16:57:51 +0100
Il giorno gio, 03/03/2011 alle 16.54 +0100, Marco Trevisan (Treviño) ha
scritto:
Il giorno mer, 02/03/2011 alle 20.33 +0000, Graham Whelan ha scritto:
int main (string[] args) {
int a[5] = {1, 2, 3, 4, 5};
return 0;
}
You should use:
int[] a = {1, 2, 3, 4, 5};
Sorry I forgot const... The array should be set as constant:
const int[] a = {1, 2, 3, 4, 5};
So the generated C code will be:
static const gint a[5] = {1, 2, 3, 4, 5};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]