www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/11/23:55:53

Message-Id: <199808120355.EAA08180@sable.ox.ac.uk>
Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: "George Foot" <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Endlisnis <s257m AT unb DOT ca>
Date: Wed, 12 Aug 1998 04:54:24 +0000
MIME-Version: 1.0
Subject: Re: Trouble with many mallocs and reallocs
Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk
CC: djgpp AT delorie DOT com

On 11 Aug 98 at 17:28, Endlisnis wrote:

> Bruno Barberi Gnecco wrote:
> 
> > struct node {
> >   struct node *forward, *back;
> >   unsigned char *data;
> >   };
> > typedef struct node NODE;
> 
>     Why do you use a typedef to reference 'node' as 'NODE'?
> node a;   //SAME AS
> NODE a;

He didn't, he typdeffed `struct node' as `NODE'.

> PS:  You don't need to use the word 'struct' when declaring node pointers, you can
> just say node*.

In C++ that is true, but in C you need an explicit typedef before you 
can do that.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


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