home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!dkuug!login.dkuug.dk!kimcm
- From: kimcm@login.dkuug.dk (Kim Chr. Madsen)
- Newsgroups: comp.lang.c
- Subject: Re: printf question
- Message-ID: <kimcm.714943581@login.dkuug.dk>
- Date: 27 Aug 92 19:26:21 GMT
- References: <1992Aug27.143434.26965@dartvax.dartmouth.edu>
- Sender: news@slyrf.dkuug.dk
- Lines: 17
-
- eht@coos.dartmouth.edu (Edward H. Truex) writes:
-
-
- >I am trying to format a hexadecimal number whose width
- >is always a constant - like
-
- > printf("%04x\n", address );
-
- try to use the variable width specification method:
-
- printf("%0*x\n",4, adress);
-
- an asteriks in the width specification is taken as a variable that
- must be taken from the arguments and be evaluated at runtime...
-
-
- Kim Chr. Madsen
-