Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ncar!boulder!spot!cochrane
From: cochrane@spot.Colorado.EDU (COCHRANE JIM T)
Newsgroups: comp.lang.c
Subject: Re: Extension of first:he "help"
Summary: functions not declared are assumed to return int.
Message-ID: <3654@boulder.Colorado.EDU>
Date: 23 Sep 88 02:58:45 GMT
References: <9600002@silver>
Sender: news@boulder.Colorado.EDU
Reply-To: cochrane@spot.Colorado.EDU (COCHRANE JIM T)
Organization: University of Colorado, Boulder
Lines: 30



/*	You missed two things, noted below in comments.		*/


struct string
   {
     char content;
     struct string *next;
   };
typedef struct string STRING;

main()
{
    STRING *stringptr;
    STRING *newstrptr;
    STRING *newstrel();		/*	newstrel needs to be declared; otherwise	*/
							/*	it's assumed to return an int.	*/
    newstrptr = newstrel(newstrptr);     
    (*newstrptr).content = 'a';   

}    

STRING *newstrel(sptr)		/*	'*' added	*/
STRING *sptr;
{
       sptr = ( STRING * ) malloc (sizeof(STRING));
       return sptr;
}