Re: Installing property in interface



On 1/31/07, Tomasz Jankowski <tomcioj gmail com> wrote:

Please don't say me, that I was so stupid all the time :| Let say that we
have such function:

static void
maman_ibaz_base_init (gpointer g_iface)
{
  static gboolean initialized = FALSE;

  if (!initialized) {
    /* create interface signals here. */
    initialized = TRUE;
  }
}

I'm quite young programmer (it's my hobby only), but I'm almost sure, that
all variables declared inside function are destroyed when function execution
if finished. Does 'static' keyword changes this behavior?!

That is exactly what "static" does:
http://www.phim.unibe.ch/comp_doc/c_manual/C/CONCEPT/storage_class.html#static

-D



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