GList weirdness



Hello...

I'm building a combo box using items found in a database..
Having a weird problem with the behavior of a GList. Here is the code excerpt:

GList *countries = NULL;
.
.
.
while((row = mysql_fetch_row(result)))
	{
	  printf("fetching %s\n", row[0]);
	  countries = g_list_append(countries, (gpointer)row[0]);
	  printf("countries = %s\n", countries->data);

	}
     printf("outside while countries = %s\n", countries->data);
     combo = gtk_combo_new();
     gtk_combo_set_popdown_strings(GTK_COMBO(combo), countries);
.
.
.
The out put is as follows:

fetching United States
countries = United States
fetching Canada
countries = Canada
outside while countries =


I have NO CLUE why the values are disappearing outside of that while loop. The declaration for countries is inside the same func. Anyone know?


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





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