| delorie.com/archives/browse.cgi | search |
| From: | Charles Krug <charles AT mail DOT pentek DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Newbie Question (variable dec.) |
| Date: | Thu, 11 Feb 1999 12:10:41 -0500 |
| Organization: | Pentek Corporation |
| Lines: | 23 |
| Message-ID: | <36C30F11.7CCB2EAE@mail.pentek.com> |
| References: | <36c399d2 DOT 18754602 AT news DOT okstate DOT edu> |
| NNTP-Posting-Host: | mail.pentek.com |
| Mime-Version: | 1.0 |
| X-Mailer: | Mozilla 4.5 [en] (WinNT; U) |
| X-Accept-Language: | en |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Carl Marg wrote:
> I'm using DJGPP, and I've noticed that it will not allow me to
> declare variable in the middle of code, i.e
>
> int x,y;
> for (x=0;x<=10;x++) printf("%i\n",x);
> for (y=0;y<=10;y++) printf("%i\n",y);
That is correct.
>nt x;
>for (x=0;x<=10;x++) printf("%i\n",x);
>int y;
>for (y=0;y<=10;y++) printf("%i\n",y);
AFAIK, that's only legal in c++. The FAQ has a few instances of things
that get accepted by things like vc++ but which are incorrect for C
programs, such as "//" to delimit comments. Check the FAQ for this.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |