Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!bionet!ames!ucsd!sdcsvax!ucsdhub!esosun!seismo!uunet!vicorp!charlie From: charlie@vicorp.UUCP (Charlie Goldensher) Newsgroups: comp.lang.c Subject: Re: Different pointer representations on the same machine Summary: %p not available for all versions of printf Message-ID: <1089@vicorp.UUCP> Date: 23 Feb 89 19:35:57 GMT References: <3675@arcturus> <1989Feb15.200416.15836@utzoo.uucp> <9382@bloom-beacon.MIT.EDU> Distribution: usa Organization: V. I. Corporation, Amherst, Massachusetts Lines: 11 In article <9382@bloom-beacon.MIT.EDU>, scs@adam.pika.mit.edu (Steve Summit) writes: > In article <2310@scolex.sco.COM> seanf@scolex.UUCP (Sean Fagan) writes: > >when you print out a pointer... do you typecast it to long and > >use a %ld format? > > No, I just use %p. That's fine if you don't expect to port the code to another machine. But be aware that not all versions of printf provide the %p option. I typecast the pointer to a long and use 0x%lx. (I find the hex notation more useful for pointers than the decimal notation.)