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

From: zidharta AT yahoo DOT com
Newsgroups: comp.os.msdos.djgpp,comp.os.programmer,comp.graphics.algorithms
Subject: Re: struct problem
Date: Tue, 10 Aug 1999 23:26:59 GMT
Organization: Deja.com - Share what you know. Learn what you don't.
Lines: 45
Message-ID: <7oqcfo$571$1@nnrp1.deja.com>
References: <A7083B60FEDED7E0 DOT 7F2CBC07CD9B5AB8 DOT 019CE2E485CE12C4 AT lp DOT airnews DOT net>
NNTP-Posting-Host: 202.49.198.2
X-Article-Creation-Date: Tue Aug 10 23:26:59 1999 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
X-Http-Proxy: 1.1 x29.deja.com:80 (Squid/1.1.22) for client 202.49.198.2
X-MyDeja-Info: XMYDJUIDsidxidzid
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

instead of
vert_3d p000;
try
struct vert_3d p000;
when you declare the variable

Sid


In article
<A7083B60FEDED7E0 DOT 7F2CBC07CD9B5AB8 DOT 019CE2E485CE12C4 AT lp DOT airnews DOT net>,
  kay DOT heyman AT airmail DOT net 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;
>
> After compiling the program I get an error that says there is a syntax
> error in this line and every one after.
>
> p000.x = 0;  //syntax error before '.'
>
> This error happens on every single declaration of the program in every
> single struct I use.  The program gives no problems with the struct
> declarations, only on the variable assignments themselves.
>
> Thanks for any help.
>
> Matthew Heyman
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

- Raw text -


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