Path: utzoo!mnetor!uunet!husc6!bbn!rochester!ur-tut!sunybcs!boulder!murillo From: murillo@sigi.Colorado.EDU (Rodrigo Murillo) Newsgroups: comp.lang.c Subject: When do you #include ? Message-ID: <4991@sigi.Colorado.EDU> Date: 22 Mar 88 00:18:01 GMT Reply-To: murillo@boulder.Colorado.EDU (Rodrigo Murillo) Distribution: na Organization: University of Colorado, Boulder Lines: 17 I realized today that you can call functions that are in stdlib.h without actually including them in your file. But on the otherhand you can include them. Is there a hard fast rule? Let me give an example: printf("foo: %dl",atol(argv[1])); The prototype for atol() resides in stdlib.h. The above code compiles without an #include , but the expresion yields rubbish. When the stdlib.h is included, it works fine. What gives? Why doesn't the compiler barf when it encounters atol() when the stdlib.h is NOT included? -- _______________________________________________________________________________ Rodrigo Murillo, University of Colorado - Boulder (303) 761-0410 murillo@boulder.colorado.edu | ..{hao|nbires}!boulder!murillo ( Machines have less problems. I'd like to be a machine. -- Andy Worhol )