From owner-freebsd-hackers Fri Feb 26 11: 7:38 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp1.vnet.net (smtp1.vnet.net [166.82.1.31]) by hub.freebsd.org (Postfix) with ESMTP id 168EE14FE5 for ; Fri, 26 Feb 1999 11:07:28 -0800 (PST) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp1.vnet.net (8.9.1a/8.9.1) with ESMTP id OAA11562; Fri, 26 Feb 1999 14:06:51 -0500 (EST) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.1/8.8.5) with ESMTP id OAA06090; Fri, 26 Feb 1999 14:06:50 -0500 (EST) Received: (from rivers@localhost) by lakes.dignus.com (8.9.1/8.6.9) id OAA14251; Fri, 26 Feb 1999 14:07:15 -0500 (EST) Date: Fri, 26 Feb 1999 14:07:15 -0500 (EST) From: Thomas David Rivers Message-Id: <199902261907.OAA14251@lakes.dignus.com> To: Hackers@FreeBSD.ORG, Matthew.Alton@anheuser-busch.com Subject: Re: printf wierdness Cc: Matt.Ladendorf@anheuser-busch.com In-Reply-To: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Why is this happening? > > > $ vi foo.c > > #include > > int > main(void) > { > unsigned long long int foo = 0; > char *bar = "Hidely Ho!"; > > (void)printf("%llu %s\n", foo, bar); > (void)printf("%s %llu\n", bar, foo); > > return 0; > } I believe you've got the wrong printf() specifications. I think you want: printf("%qu %s\n", foo, bar); printf("%s %qu\n", bar, foo); - Dave R. - > foo.c: 14 lines, 196 characters. > $ make foo > cc foo.c -o foo > $ ./foo > 0 (null) > Hidely Ho! 0 > $ > > Matthew Alton > Computer Services - UNIX Systems Administration > (314)632-6644 matthew.alton@anheuser-busch.com > alton@plantnet.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message