From: M J. R. <jo...@um...> - 2002-04-01 15:49:57
|
you WILL need to include it if you attempt to call printf again with a different number of arguments. when a function call is encountered without a preceding declaration (in C), it is often assumed to return and int and take the number and type of parameters supplied. when you use it the first time (or once) like you did, it is implicitly declared as int printf(char *); attempting to call it later with a different parameter list will fail if it differs from this declaration. this includes such things as printf("%d", 5); printf("%s", "boo!"); in short, always include the header file. M Joshua Ryan Vera went to see a man about an avacado On Sat, 30 Mar 2002, Victor Munoz wrote: > Hi, > > I just run this program > > int main(int argc, char **argv) { > printf ("\n\aHello\n"); > return (0); > } > > then I compiled > > gcc -o Hello Hello.c > > and got the executable. It is working OK > > The question is Why I dont need the #include <stdio.h> at the begining > of the program? > > Is it a glitch? > > Note: I check my environment and no indication of lib or any other path > to lib > > and search for stdio.h in all directories and I found only located in > MinGW\include\stdio.h > > Thanks, > > Victor Munoz > > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |