Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: printf format Message-ID: <1940@crdos1.crd.ge.COM> Date: 20 Dec 89 20:17:46 GMT References: <5761@ozdaltx.UUCP> <987@nsi.UUCP> Organization: GE Corp R&D Center, Schenectady NY Lines: 19 Reply-exos:@crdgw1:To: davidsen@crdos1.crd.ge.com (bill davidsen) In article <987@nsi.UUCP> javiv@nsi.UUCP (Javier Vilarroig Christensen.) writes: | In article <5761@ozdaltx.UUCP> root@ozdaltx.UUCP (root) writes: | >In the back of my mind, it seems like I read that there is a format | >character used in printf(C) that allows the formatting of numbers. | | It's imposible to do this with printf. You must make a funtion to do it in | a string, and then feed it to printf. Since I can't read the original poster's mind, I'll take a stab that he *might* be thinking of the * character, used to specify the width in an argument evaluated at runtime. Ex: n = 14; /* set field width */ printf("Val: %*d sec", n, m); -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon