www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/06/10:32:05

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: how do i define structures ?
Date: Sun, 06 Sep 1998 10:33:36 -0300
Organization: NBTel Internet
Lines: 24
Message-ID: <35F28F30.D1B1BD1F@unb.ca>
References: <000101bdd8ea$aa4d9540$5d4d08c3 AT arthur>
NNTP-Posting-Host: fctnts05c94.nbnet.nb.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Arthur wrote:
> >  int x;
> >  int y;
> >} mystruc;
> 
> Do you actually need the last mystruct? Perhaps I've been using C++ for too
> long (where you don't even need typedef), but I thought that you could
> define a typedef'd structure thus:
> 
> typedef structs mystruct {
>     int x;
>     int y;
> }
	You will need a trailing ';'.  Also, for a typedef, you need 2 things: the
type, and a name for it.  The type is "struct mystruct {int x; int y;}" and
the name for it is "mystruct".  So you do need the last "mystruct".

-- 
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT GeoCities DOT com
          Endlis AT nbnet DOT nb DOT ca


- Raw text -


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