[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Modifying element of GArray
- From: Vladimir Djokic <vladeck sezampro yu>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: Modifying element of GArray
- Date: 02 Feb 2003 22:23:08 +0100
> > Now, I'm packing these structs into a GArray, but how can I modify
> > value of GArray at a specified index?
>
> Use the g_array_index macro. In your example:
>
> KGrade *pgrade = g_array_index(grade_array, KGrade, index);
>
Thanks!
> I think the example in the docs is wrong; there is an & before g_array_index
> that should not be there.
>
Well, I looked at the GArray src, and I think you're right:
#define g_array_index(a,t,i) (((t*) (a)->data) [(i)])
return value is casted to a pointer of xxx type (t*).
--
"This is it... This is where I belong..."
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]