Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Typecasting in C
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Harti Brandt, post: 2378228"] On Tue, 29 Jun 2004, Arthur J. O'Dwyer wrote: AJO> AJO>On Tue, 29 Jun 2004, jacob navia wrote: AJO>> AJO>> The expression AJO>> printf("the address is: 0x%x\n",p); AJO>> where p is some pointer appears in several million lines in AJO>> existing code. AJO> AJO> Has anyone besides Jacob ever seen this construct (or anything AJO>similar) in real-world code? I've never encountered it. The AJO>usual idiom in my part of the universe is more like AJO> AJO> printf("(%d) %p\n", p!=NULL, (void*)p); AJO> AJO>which has the benefit of (a) telling you something useful, and AJO>(b) being standard, warning-less C code. AJO> AJO> Who's been using "%d" or "%x" to print *pointer* values? %p is a quite new feature for printf(). Neither V7 nor BSD had this, so the natural way of printing pointers was %x. Don't assume that everybody out there does a daily update of it's compilers and libraries to the current gcc. harti [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Typecasting in C
Top