[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Modifying element of GArray
- From: Roland Smith <rsmith xs4all nl>
- To: gtk-app-devel-list gnome org
- Subject: Re: Modifying element of GArray
- Date: Sun, 2 Feb 2003 13:53:33 +0100
On 01 Feb 2003 18:23:49 +0100
Vladimir Djokic <vladeck@sezampro.yu> wrote:
> I want to improve my school projects, so i decided to represent grade
> as a struct:
>
> typedef struct _KGrade KGrade;
>
> struct _KGrade {
> gchar *grade;
> gfloat real_value;
> GDate *date_entered;
> GDate *date_modified;
> };
>
> 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);
I think the example in the docs is wrong; there is an & before g_array_index
that should not be there.
HTH, Roland
--
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]