Xref: utzoo comp.lang.c:22411 comp.lang.c++:4891 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!um-math!sharkey!cfctech!teemc!hpftc!zardoz!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!usc!rutgers!columbia!cubmol!ping From: ping@cubmol.BIO.COLUMBIA.EDU (Shiping Zhang) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: ttyname() - question Message-ID: <328@cubmol.BIO.COLUMBIA.EDU> Date: 29 Aug 89 23:50:10 GMT References: <99@lkbpyr.UUCP> Reply-To: ping@cubmol.UUCP (Shiping Zhang) Organization: Dept. of Biology, Columbia Univ., New York, NY Lines: 40 In article <99@lkbpyr.UUCP> jonas@lkbpyr.UUCP (Jonas Heyman) writes: >Hello, > >I was wondering why this work: >#include>main() >{ > char *term; > char *ttyname(); > term=ttyname(); > printf("%d",term); >} I am wondring too because the format of printf() should be %s. >And why this don't: >#include >main() >{ > test(); >} > >test() >{ > char *term; > char *ttyname(); > term=ttyname(); > printf("%d",term); >} I guess because the format of printf() is incorrect. -ping