Re: Is this OK?



On Sun, Oct 13, 2002 at 06:39:36PM -0400, Scott Barron wrote:
KStudent*
k_student_new ()
{
        KStudent *student = g_new0(KStudent, 1); 
      student->profile = g_new0(KEducationProfile, 1);
      student->father = g_new0(KParent, 1); 
      student->mother = g_new0(KParent, 1);
      student->foster = g_new0(KParent, 1);
      return student;
}

Woops, g_malloc0() is probably better than g_new0() in the case of
always just allocating one structure.  Sorry :)

-Scott



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