From: CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 11-SEP-1988 13:10 To: ARISIA::EVERHART Subj: Re: VAXC format flags Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Sun, 11 SEP 88 09:45:37 PDT Received: from LBL.Gov by KL.SRI.COM with TCP; Sun, 11 Sep 88 09:20:17 PDT Received: from warner.hepnet by LBL.Gov with VMSmail ; Sun, 11 Sep 88 09:17:36 PDT Date: Sun, 11 Sep 88 09:17:36 PDT From: nagy%warner.hepnet@LBL.Gov (Frank J. Nagy, VAX Wizard & Guru) Message-Id: <880911091736.21a036a0@LBL.Gov> Subject: Re: VAXC format flags To: Info-VAX@kl.sri.com X-ST-Vmsmail-To: INFO_VAX > The file SYS$HELP:VAXC023.RELEASE_NOTES informs me of, among other > things, "... the addition of three new format flags (#, +, space) and > the following new format specifiers: i, p, and n" for the printf and scanf > functions. We received our C RTL documentation only recently and yet it > doesn't contain explanations of these format flags and specifiers. How > can I find out what they do??? They are documented in the V2.4 Release Notes for VAX C. Here is a short explanation cribbed from same: n conversion specifier like %d except no input is consumed. The argument corresponding to %n must be pointer to integer into which is written the number of characters read from the input stream by this point in the fscanf call. p conversion specifier for input/output. %p by fprintf outputs the value of a pointer in an implementation-defined manner. For fscanf, returns the pointer value back to an argument which should be a pointer to a pointer to void. -, +, space, and # conversion flags between the "%" and the conversion specifier. "-" specifies left justification. "+" specifies signed conversion with an explicit sign always present " " requests a space to appear before the result "#" requests the result to be converted to an alternate form depending on the conversion done: o the first digit will always be zero. x Prepends 0x e,E,f,F,g,G result will always contain a decimal point = Frank J. Nagy "VAX Guru & Wizard" = Fermilab Research Division EED/Controls = HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY) = BitNet: NAGY@FNAL = USnail: Fermilab POB 500 MS/220 Batavia, IL 60510