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

  • Follow


Hi all,

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

regards,
Jay

0
Reply jayapal403 (24) 10/30/2007 9:28:07 AM

"jayapal" <jayapal403@gmail.com> schrieb im Newsbeitrag 
news:1193736487.154681.256890@k35g2000prh.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 


0
Reply nospam.jojo (1344) 10/30/2007 9:35:10 AM


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.

0
Reply santosh.k83 (3969) 10/30/2007 9:47:36 AM

On Oct 30, 11:47 am, santosh <santosh....@gmail.com> wrote:
> 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.

0
Reply vipvipvipvipvip.ru (21) 10/30/2007 11:13:57 AM

On Oct 30, 2:35 pm, "Joachim Schmitz" <nospam.j...@schmitz-digital.de>
wrote:
> "jayapal" <jayapal...@gmail.com> schrieb im Newsbeitragnews:1193736487.154681.256890@k35g2000prh.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?

0
Reply jayapal403 (24) 10/30/2007 4:07:06 PM

"jayapal" <jayapal403@gmail.com> schrieb im Newsbeitrag 
news:1193737773.313543.326050@e34g2000pro.googlegroups.com...
> On Oct 30, 2:35 pm, "Joachim Schmitz" <nospam.j...@schmitz-digital.de>
> wrote:
>> "jayapal" <jayapal...@gmail.com> schrieb im 
>> Newsbeitragnews:1193736487.154681.256890@k35g2000prh.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 


0
Reply nospam.jojo (1344) 10/30/2007 4:09:18 PM

jayapal <jayapal403@gmail.com> writes:
> what is %p format specifier indicates in the printf statement?

What does your textbook say?

-- 
Keith Thompson (The_Other_Keith) kst-u@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"
0
Reply kst-u (21474) 10/30/2007 7:44:07 PM

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.com> schrieb im Newsbeitragnews:1193736487.154681.256890@k35g2000prh.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.

0
Reply army1987 (668) 10/30/2007 9:39:29 PM

7 Replies
36 Views

(page loaded in 0.178 seconds)

Similiar Articles:




7/14/2012 3:12:28 AM


Reply: