| cvs.gedasymbols.org/archives/browse.cgi | search |
| From: | Matthew Heyman <kay DOT heyman AT airmail DOT net> |
| Newsgroups: | comp.os.msdos.djgpp,comp.graphics.algorithms |
| Subject: | Re: struct problem... structs within struct |
| Date: | Tue, 10 Aug 1999 21:52:53 +0000 |
| Organization: | Airnews.net! at Internet America |
| Lines: | 41 |
| Message-ID: | <F6FDA3A1EAD00258.02C56ED9190A4211.6C249933DBA77C44@lp.airnews.net> |
| X-Orig-Message-ID: | <37B09F35 DOT 1D8F AT airmail DOT net> |
| 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> <37B0D224 DOT 4D5D AT ns DOT sympatico DOT ca> |
| Abuse-Reports-To: | abuse at airmail.net to report improper postings |
| NNTP-Proxy-Relay: | library2.airnews.net |
| NNTP-Posting-Time: | Tue Aug 10 21:53:12 1999 |
| NNTP-Posting-Host: | !ajq41k-WcT=YI? (Encoded at Airnews!) |
| Mime-Version: | 1.0 |
| X-Mailer: | Mozilla 3.01C-KIT (Win95; U) |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Klaas wrote:
>
> 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
Your code snippet worked fine. My program narrowed down a few of the
errors when I moved the assignments to inside a function. In all
likelihood, I have made an error when assigning values in the various
structs I use for world construction.
Matthew Heyman
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |