[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Modifying element of GArray



On 02 Feb 2003 22:23:08 +0100
Vladimir Djokic <vladeck@sezampro.yu> wrote:

> 
> > > 	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!

Be sure that your index is valid, though. Otherwise there could be "interesting"
side effects. :-)

-- 
R.F. Smith                           /"\    ASCII Ribbon Campaign
r s m i t h @ x s 4 a l l . n l      \ /    No HTML/RTF in email
http://www.xs4all.nl/~rsmith/         X     No Word docs in email
                                     / \    Respect for open standards

PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]