Date: Sat, 24 Jan 1998 13:19:36 -0800 (PST) Message-Id: <199801242119.NAA03073@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Mike Coulson , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Very simple: What am I doing wrong? Precedence: bulk At 08:42 1/23/1998 +0000, Mike Coulson wrote: >The following code produces errors on my compiler (DJGPP). >Is this code OK? I have no idea, and am only a beginner. >I have heard that C++ allows functions to be put into structures. I have >tried to do this, and get errors. > >struct a ( > int vara; > void addone() { > vara++; > } > ); You can't have a source file with only a structure declaration. The declaration is fine, but it is meaningless by itself. Typically you would put it in a header file, and include it in any code which wanted to use `struct a'. This is a basic C++ question and would be better directed to a comp.lang.c++ newsgroup. Nate Eldredge eldredge AT ap DOT net