[Vala] Initialization Error!!!
- From: "Matías De la Puente" <mfpuente ar gmail com>
- To: vala-list gnome org
- Subject: [Vala] Initialization Error!!!
- Date: Wed, 28 May 2008 19:28:57 -0300
Hello
The following code do not work because the value in 'x' and 'y' in 'd' are not 24 and 3.
The structure is not initialized in an appropriate manner.
using GLib;
public class Sample : Object
{
struct Data
{
public int x;
public int y;
}
public static void main (string[] args)
{
int i = 24;
int j = 3;
Data d = {i, j};
stdout.printf ("x = %d, y = %d\n", d.x, d.y);
}
}
In the C code, I see that in the structure is initialized before the variables:
gint i;
gint j;
SampleData d = {i, j};
i = 24;
j = 3;
Can anyone fix this? Because when i work with pointer there is a Segmentation Fault. Thanks
Matias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]