cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/26/19:33:13

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Local Variables
Date: Wed, 26 Aug 1998 16:06:03 -0700
Organization: Alcyone Systems
Lines: 33
Message-ID: <35E494DB.530FD2D8@alcyone.com>
References: <35DF103A DOT 600FF384 AT earthlink DOT com>
NNTP-Posting-Host: charmaine.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

puva AT earthlink DOT net wrote:

> void main()
> {
>         int a;
> }
> 
> would give an error like, "parse error before int" or "parse error
> before a". It works fine if the variables are outside of main(), but
> not
> anything local. Is there something wrong with how the compiler is
> setup?
> or is there a header missing or something?

You don't need to include any headers unless you're declaring some
nonfundamental type that's defined in those headers.

Considering that what you were trying to do is a fundamental part of the
language that everyone uses, there is something else wrong with your
declarations.  Since you didn't give an actual example of something
which didn't work and what the errors were, it's hard to help you more
than that.

main should always be declared to return int, by the way.

-- 
Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900 
Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com
  San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/
          USA / icbm 37 20 07 N 121 53 38 W / &tSftDotIotE
             \
            / You win the victory when you yield to friends.
           / Sophocles

- Raw text -


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