*BSD News Article 84433


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!howland.erols.net!news.mathworks.com!fu-berlin.de!cs.tu-berlin.de!js
From: js@cs.tu-berlin.de (Joerg Schilling)
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: Solaris 2.6
Date: 7 Dec 1996 12:16:28 GMT
Organization: Technical University of Berlin, Germany
Lines: 23
Distribution: inet
Message-ID: <58bn6s$q7d$1@news.cs.tu-berlin.de>
References: <32986299.AC7@mail.esrin.esa.it> <587mc1$1dc@cucumber.demon.co.uk> <casper.32a804ad@mail.fwi.uva.nl> <589ao6$lga@prometheus.acsu.buffalo.edu>
NNTP-Posting-Host: 130.149.17.8
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:91712 comp.unix.bsd.misc:1720 comp.unix.internals:11502

You forget to say, that %p is guaranteed to produce an output format
that may be read in again with *scanf(). So it is really portable.

Joerg

In article <589ao6$lga@prometheus.acsu.buffalo.edu>,
Davin Milun <milun@cs.buffalo.edu> wrote:
>Casper H.S. Dik <casper@fwi.uva.nl> wrote:
>»Does DU have a %p printf directive?  Perhaps that is even on some
>»standards track?
>
>%p is listed as a printf directive in Harbison and Steele's 3rd Ed. "C: A
>Reference Manual".  It notes that it's defined in ANSI C (but that few
>non-ANSI compilers implement it).  It lists it as taking a void*, but that
>the modifying flags, and the output format, is "implementation defined".
>
>So, that should be the portable way of printing a pointer, regarless of
>type/length.
-- 
EMail:	joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
	js@cs.tu-berlin.de		  (uni)  If you don't have iso-8859-1
	jes@fokus.gmd.de		  (work) chars my name is
URL:	http://www.fokus.gmd.de/usr/schilling    J"org Schilling