469,603 Members | 2,069 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,603 developers. It's quick & easy.

what is %p format specifier indicates in the printf statement?

Hi all,

what is %p format specifier indicates in the printf statement?

regards,
Jay

Oct 30 '07 #1
7 38997
"jayapal" <ja********@gmail.comschrieb im Newsbeitrag
news:11**********************@k35g2000prh.googlegr oups.com...
Hi all,

what is %p format specifier indicates in the printf statement?
it is to print a pointer. The format of that isn't specified in the standard

Bye, Jojo
Oct 30 '07 #2
jayapal wrote:
Hi all,

what is %p format specifier indicates in the printf statement?
It's purpose is to print a pointer value in an implementation defined
format. The corresponding argument must be a void * value.

Oct 30 '07 #3
On Oct 30, 11:47 am, santosh <santosh....@gmail.comwrote:
jayapal wrote:
Hi all,
what is %p format specifier indicates in the printf statement?
The value of the void * object will be converted to a sequence of
printing characters, in an implementation-defined way.

To be realistic, most implementations use a hexademical string
representation of the value.

Oct 30 '07 #4
On Oct 30, 2:35 pm, "Joachim Schmitz" <nospam.j...@schmitz-digital.de>
wrote:
"jayapal" <jayapal...@gmail.comschrieb im Newsbeitragnews:11**********************@k35g2000p rh.googlegroups.com...Hi all,
what is %p format specifier indicates in the printf statement?

it is to print a pointer. The format of that isn't specified in the standard

Bye, Jojo
pointer in the sense the address of the variable?
Is %u and %p are same?

Oct 30 '07 #5

"jayapal" <ja********@gmail.comschrieb im Newsbeitrag
news:11**********************@e34g2000pro.googlegr oups.com...
On Oct 30, 2:35 pm, "Joachim Schmitz" <nospam.j...@schmitz-digital.de>
wrote:
>"jayapal" <jayapal...@gmail.comschrieb im
Newsbeitragnews:11**********************@k35g2000 prh.googlegroups.com...>
Hi all,
what is %p format specifier indicates in the printf statement?

it is to print a pointer. The format of that isn't specified in the
standard

Bye, Jojo

pointer in the sense the address of the variable?
for example
Is %u and %p are same?
no

Bye, Jojo
Oct 30 '07 #6
jayapal <ja********@gmail.comwrites:
what is %p format specifier indicates in the printf statement?
What does your textbook say?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Oct 30 '07 #7
On Tue, 30 Oct 2007 09:07:06 -0700, jayapal wrote:
On Oct 30, 2:35 pm, "Joachim Schmitz" <nospam.j...@schmitz-digital.de>
wrote:
>"jayapal" <jayapal...@gmail.comschrieb im Newsbeitragnews:11**********************@k35g2000p rh.googlegroups.com...Hi all,
what is %p format specifier indicates in the printf statement?

it is to print a pointer. The format of that isn't specified in the standard
pointer in the sense the address of the variable?
It has to be a pointer to void. You can convert an address into
one with a cast:
printf("%p\n", (void *)&var);
Is %u and %p are same?
No. %u is for printing an unsigned int in decimal.
--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.

Oct 30 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by aditya | last post: by
18 posts views Thread by Money | last post: by
1 post views Thread by dis_is_eagle | last post: by
2 posts views Thread by =?Utf-8?B?Um9ubmllIFNtaXRo?= | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.