Problem with printf()

Maarten Litmaath maart at cs.vu.nl
Sat Oct 8 02:25:12 AEST 1988


In article <504 at imec.UUCP> croes at 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 at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list