delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/11/22:21:44

Message-ID: <37B0D224.4D5D@ns.sympatico.ca>
From: Klaas <klaas1 AT ns DOT sympatico DOT ca>
Organization: N/A
X-Mailer: Mozilla 3.04 (Win95; I)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp,comp.graphics.algorithms
Subject: Re: struct problem... structs within struct
References: <A7083B60FEDED7E0 DOT 7F2CBC07CD9B5AB8 DOT 019CE2E485CE12C4 AT lp DOT airnews DOT net> <37AF5947 DOT 66951F05 AT NOSPAMthepentagon DOT com> <8432818566957DB4 DOT DF5776918DB4D437 DOT AD3715803EC19E27 AT lp DOT airnews DOT net> <37B0847D DOT 60A75CAB AT NOSPAMthepentagon DOT com> <615620E39BE81788 DOT CF8A6B1990FBBD97 DOT C41A8FB435290DCC AT lp DOT airnews DOT net>
Lines: 31
Date: Tue, 10 Aug 1999 22:30:12 -0300
NNTP-Posting-Host: 142.177.85.68
X-Trace: sapphire.mtt.net 934334984 142.177.85.68 (Tue, 10 Aug 1999 22:29:44 ADT)
NNTP-Posting-Date: Tue, 10 Aug 1999 22:29:44 ADT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Matthew Heyman wrote:
> 
> All right....  digging through my code and came up with a possible
> realization.   In several instinces I use structs within structs.  Is
> this possible?  Consider the following piece of code...
> 
> typedef struct
> {
> int x;
> }point;
> 
> typedef struct
> {
> point loc;
> }vert;
> 
> point p1;
> p1 = 2;
> vert v1;
> v1 = p1;
> //and to access the final point within the vert
> cout <<v1.loc.x<<endl;
> 
> Is my logic messed up?  Can I even do this in?
> 
> Matthew Heyman

You can use structs within structs.  Btw did that cope snippet of mine
compile?  I'm interested in that answer...

-Mike

- Raw text -


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