delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/26/17:32:16

Message-ID: <38148915.77C8A961@connect.ab.ca>
Date: Mon, 25 Oct 1999 16:45:09 +0000
From: Tom Fjellstrom <tomcf AT connect DOT ab DOT ca>
X-Mailer: Mozilla 4.61 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: URGENT!!! Please (A Little Long)
References: <3813e85f DOT 18243975 AT news DOT pasteur DOT dialix DOT com DOT au>
NNTP-Posting-Host: ppp0224.connect.ab.ca
X-Trace: 25 Oct 1999 16:39:56 -0600, ppp0224.connect.ab.ca
Lines: 33
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello Kieran,

in AddStudent() when you try to 'link' New to Start, Start doesn't really
exist.
What I mean is that sense Start is just a pointer to a STUDENT struct
It has to be allocated some memory. i.e.:

int main(void)
{
    STUDENT *Start = calloc(1,sizeof(STUDENT));
    if(!Start) { fprintf(stderr,"couldn't allocate Student list!\n");
return 0; }

    AddStudent(Start);
    CleanUp(Start);

    return 0;
}

mind you I haven't tested this so it may not work, and I probably missed
something. :)
Hope this helps.

--

"An Optimist will say the glass is half full,
 A Pessimist will say the glass is half empty,
 A Canadian will say Waiter!"

Tom Fjellstrom
tomcf AT connect DOT ab DOT ca


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019