RE: Simple procedure question
- From: Ivo Andrejco <andrejcoivo yahoo com au>
- To: gtk-app-devel-list gnome org
- Subject: RE: Simple procedure question
- Date: Tue, 18 Feb 2003 22:34:51 +1100
Hi,
I am not sure, but I think you have to initialize list to NULL such as:
Here is an example:
#include <glib.h>
int main()
{
GList* list = NULL;
list = g_list_append( list,"Hello" );
list = g_list_append( list,"World" );
while( list != NULL )
{
gchar* data = (gchar*)list->data;
g_print("%s\n",data);
list = g_list_next(list);
}
}
if you try that without initializing to NULL you get segment fault.
If it's not what you where asking about then sorry.
Ivo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]