@get


Description:

[ CCode ( cname = "g_ptr_array_index" ) ]
public unowned G @get (uint index)

Example: Get the nth entry:

public static int main (string[] args) {
GenericArray<string> array = new GenericArray<string> ();
array.add ("first entry");
array.add ("second entry");
array.add ("third entry");

// Output: ``first entry``
print ("%s\n", array.get (0));

// Output: ``second entry``
print ("%s\n", array.get (1));

// Output: ``third entry``
print ("%s\n", array.get (2));

// Output: ``null``
print ("%s\n", array.get (3));

return 0;
}

valac --pkg glib-2.0 GLib.GenericArray.get.vala