Re: [Dev-C++] clrscr() and c99 compatibility
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2002-09-24 19:48:36
|
Check which version of gcc you are using. This isn't a problem if compiled
as c++ but definitely is when compiling with old gcc in c mode.
Traditional c doesn't allow variable declarations other than absolutely
first in a function.
/Per W
On Tue, 24 Sep 2002, metalseb wrote:
> Good afternoon Matthew
>
> >Code snippet: This happened several times with me, so I'm quite interested
> >to find out the reason why.
> >
> >sample code:
> >
> >void log_in(void)
> >{
> > clrscr();
> > printf("User login: ");
> > char login[80];
> > gets(login);
> > int c;
> > c = atoi(login);
> > if (c != 0 || c != 1 || c != 2) {
> > clrscr();
> > printf("Invalid login.");
> > for (;;) {
> > if (kbhit()) break;
> > }
> > }
> >}
> >
> >And it would give me a parsing error at "char login[80]" every time.
> >What's up?
>
> I tried it on my DevCpp 4.9.4.1 package and it gave me no compiling errors. And I really can't
> see why this should gave you errors at compile time.
>
> Kind regards
>
> --
> Seb
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|