delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/03/12:45:20

From: Radical NetSurfer <radsmail AT juno DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: syntax E?r?r?o?r?
Date: Sun, 02 Jul 2000 20:36:37 -0400
Message-ID: <ohnvlskl8vhi21rafs0pbse2q2do79aehs@4ax.com>
References: <go9tls4tdiruq2kv68c5m6f0otoerndr1a AT 4ax DOT com>
X-Newsreader: Forte Agent 1.8/32.548
X-No-Archive: yes
MIME-Version: 1.0
NNTP-Posting-Host: 216.202.134.157
X-Original-NNTP-Posting-Host: 216.202.134.157
X-Trace: 2 Jul 2000 20:39:08 -0400, 216.202.134.157
Lines: 60
X-Original-NNTP-Posting-Host: 64.31.79.51
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Lets see if I have this right:

It is _NOT_ possible to _mix_ code and declarations,
(or at least as indicated in my original example) ?!?
Hmm... this is news to me, and sounds like that would
break a whole lot of code thats out there.

2nd: I suppose I should remember that not everybody would
   of recognized that I had enough foresight to have actually
   of had <time.h> and the Rseed declaration as well, and the rest in
the ACTUAL program.... (sheesh people!)

3rd: What I am amazed at was that GCC was giving me a
   "parse error ... trnd...", which technically seemed silly.
 and ONLY after adding additional declarations (oh yeah,
the actual clincher: a statment thats more "code-like" than
declaration)... should of seen that myself.

I am aware that declaring variables thus:
  for (int i=0; i<1000; ++i ) { }  
    used to be considered perfectly acceptable,
   also interspersing declarations and "code" perse,
   is tolerable under certain conditions.

BOTTOM LINE: GCC only seems to complain at certain times,
  and not others... try it sometime with my original example.
[or yeah, for those who aren't intuitive to have know, remember
the <time.h>, Rseed, etc etc stuff..ok?]

I wasn't trying other compilers; I was concerned with DJGPP's
reaction at the time.

AGAIN: I do pay attention to the responses, so thanks.

On Sat, 01 Jul 2000 22:24:36 -0400, Radical NetSurfer
<radsmail AT juno DOT com> wrote:

>OK! enough is quite enough for Crying Out Loud!
>
>int main(int argc, char **argv) {
>int retv;
>    
>    retv = 0;  /* return value from functions */
>
>/*** Random Number Initialization **********/
>     time_t trnd;                   
>     Rseed    = time(&trnd);  
>     srand((unsigned)Rseed);
>
>[snip]
>} //main()
>
>OK!  How is this a Compiler ERROR ?!!?!?!!?!?!?!?!!?!?!?
>
>sheesh! and golly g-willikurs!
>
>Always delighted to get (intelligent) Email:
>radsmail AT juno DOT com
>http://members.tripod.com/~RadSurfer/

- Raw text -


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