delorie.com/archives/browse.cgi | search |
From: | Karl Heinz Buchegger <kbuchegg AT gascad DOT at> |
Newsgroups: | comp.os.msdos.djgpp,comp.os.programmer,comp.graphics.algorithms |
Subject: | Re: struct problem |
Date: | Wed, 11 Aug 1999 17:21:10 +0200 |
Organization: | GASCAD |
Message-ID: | <37B194E6.71053A3@gascad.at> |
References: | <A7083B60FEDED7E0 DOT 7F2CBC07CD9B5AB8 DOT 019CE2E485CE12C4 AT lp DOT airnews DOT net> |
NNTP-Posting-Host: | 194.118.74.179 |
Mime-Version: | 1.0 |
X-Trace: | leech.telecom.at 934384642 13839 194.118.74.179 (11 Aug 1999 15:17:22 GMT) |
X-Complaints-To: | abuse AT telecom DOT at |
NNTP-Posting-Date: | 11 Aug 1999 15:17:22 GMT |
X-Mailer: | Mozilla 4.5 [en] (Win95; I) |
X-Accept-Language: | en |
Lines: | 43 |
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.... I have a struct declared like this in a header file. > > typedef struct > { > int x; // x > int y; // y > int z; // z > } vert_3d; > > Within the main .cpp file I have this declaration as a global. > > vert_3d p000; > p000.x = 0; > p000.y = 10; > p000.z = 20; ?????? Do you have the assignement at a global level ? This is simply not possible because an assignement is not a declaration. vert_3d p000; // global declaration int main() { p000.x = 0; p000.y = 10; p000.z = 20; } should compile without a problem. Question: If my assumption is correct, what do you want to achieve (probably initialising the struct) ? ----------------------------------------------------------- Karl Heinz Buchegger kbuchegg AT gascad DOT at
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |