|
From: <par...@ya...> - 2002-11-19 20:31:26
|
Ioannis,
I was talking about printf on multiple lines. Kala? :)
Paul
--- Ioannis Vranos <no...@ho...> wrote: > > -----Original
Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf
> > Of Paul Ardeleanu
> > Sent: Tuesday, November 19, 2002 1:47 PM
> > To: dev...@li...
> > Subject: [Dev-C++] A simple problem
> >
> >
> > Can Anyone tell me why this code WORKS FINE in DevC++?
> > ANSI C says that it any Ansi compiler should give you an
> > error (see K&R
> > book).
> > Thank you very much!
> > Paul
> >
> > -----------------------------------------------------------
> > main ()
> > {
> > printf("hello, world
> > \n
> >
> >
> > ");
> > system("PAUSE");
> > }
>
>
> It is valid C90 code (and not C99).
>
> The main() thing is implicit int. In C90 you could do:
>
>
> const x=7;
>
> and it was equivallent to const int x=7;
>
>
> main() was equivallent to int main(). This is not the case in C99.
>
>
> Now both in C90 and C99 if you do not declare a function and you use it,
> a declaration of the type
>
>
> int whatever_you_use(); is assumed. The empty parenthesis is not
> equivallent to (void) as in C++. Empty parenthesis means that you want
> to skip argument checking.
>
>
> So when you use printf() without <stdio.h>, int printf(); is assumed.
>
>
> Ioannis Vranos
>
> * Programming pages: http://www.noicys.freeurl.com
> * Alternative URL: http://run.to/noicys
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: To learn the basics of securing
> your web site with SSL, click here to get a FREE TRIAL of a Thawte
> Server Certificate: http://www.gothawte.com/rd524.html
> _______________________________________________
> 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
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
|