Xref: utzoo comp.unix.wizards:11607 comp.lang.c:13167 Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: Problem with printf() Message-ID: <1488@solo6.cs.vu.nl> Date: 7 Oct 88 16:25:12 GMT References: <504@imec.UUCP> <548@uva.UUCP> Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatica, Amsterdam Lines: 21 In article <504@imec.UUCP> croes@imec.UUCP (Kris Croes) writes: \Hello NetLand, \ \May I introduce to you... \A little program containing a big problem. \ main() \ { \ int i = 17; \ float f = 17.0; \ \ printf("%d %f\n",i,i); /*1*/ \ printf("%d %f\n",f,f); /*2*/ \ } I have seen various explanations, none of them pointing out the ONLY error: if you're telling printf() to expect an int (%d), SUPPLY it an int, instead of a float! -- Hippic sport: |Maarten Litmaath @ Free U Amsterdam: a contradiction in terms.|maart@cs.vu.nl, mcvax!botter!maart