delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/13/19:06:22

From: beppu AT rigel DOT oac DOT uci DOT edu (John Beppu)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP inconsistencies?
Date: 13 Mar 1997 22:22:06 GMT
Organization: University of California, Irvine
Message-ID: <5g9umf$jaa@news.service.uci.edu>
References: <5g7p5i$abl AT netra DOT montana DOT edu> <01bc2fa7$9893d3c0$8c081ecb AT sly> <5g9p1b$fac AT netra DOT montana DOT edu>
NNTP-Posting-Host: rigel.oac.uci.edu
Lines: 46
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <5g9p1b$fac AT netra DOT montana DOT edu>,
Paul Peavyhouse <pv AT cs DOT montana DOT edu> wrote:

    [this didn't work for Paul]

>DATAFILE *terra;
>
> int main (int c, char **v)
> {
>         terra = load_datafile("terra.dat");
>         char *str;
> }
>

    [but this one did work for Paul]

>
>DATAFILE *terra;
>
> int main (int c, char **v)
> {
>         char *str;
>         terra = load_datafile("terra.dat");
> }
>
    Maybe you've found another difference between C and C++.  In C,
    variables need to be declared at the beginning of a function;
    with C++, this isn't the case.  Did you compile these as C 
    programs when you really meant to compile them as C++ programs?
    What error messages did you receive? 
  


>        ...IT WORKS?!?!?!  I can live with writing it this way, but I want to 
>know why the compiler pukes when I write it the other way.  Can any help me 
>here?  I'd appreciate it!

[daydreaming]

    (I wish comp.lang.asm.x86 would be liberated...  I miss it.)




-- 
  beppu AT uci DOT edu .............................................................

- Raw text -


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