473,471 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What is the difference between %x and %p format specifier ?

56 New Member
Expand|Select|Wrap|Line Numbers
  1. int *p ;
  2. printf("%p" , p);
This code printed 7EFDE000

When I used the format specifier %x , then it printed 7efde000

so its just changing the upper case letters to lower case letters , so then whats the basic difference between these two while printing address values ?
Jun 28 '15 #1
1 3145
weaknessforcats
9,208 Recognized Expert Moderator Expert
The %x is used for unsigned hexadecimal integers.

The pointer is not a hexadecimal integer but the %p will display the address in the pointer in hexadecimal.
Jun 28 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: indushekara | last post by:
Hi, We are having memory corruption in our application somewhere, unable to find out. one part of code we found that we are specifying wrong format specifier. Could anyone let me know if the...
18
by: Money | last post by:
Here in this thread http://groups.google.co.in/group/comp.lang.c/browse_frm/thread/c16d280238a95c9/e3b0dbf76f3e02e3?q=finding+endianness&rnum=1#e3b0dbf76f3e02e3 Tydr Schnubbis in 3rd reply used...
1
by: dis_is_eagle | last post by:
Hi.i dont know exactly how the format specifier %d works.please explain the following program. int main() { int k=5; printf("k=%*d",k,k); return 0; } It gives the output of k= 5.If I omit...
2
by: =?Utf-8?B?Um9ubmllIFNtaXRo?= | last post by:
Hello, I would like to be able to accept a format string in the form of say {0:D2} as an input from a dialog box, and then dynamically format the output string based on this new format...
1
by: raghunadhs | last post by:
hi! This is raghuandhs. i would like to know the format specifier of unsigned long in c? could you please say any body?
7
by: jayapal | last post by:
Hi all, what is %p format specifier indicates in the printf statement? regards, Jay
1
by: dissectcode | last post by:
Hello - I am looking at a scanf function that takes in a 16 bit unsigned int(UINT16), but its format specifier is %hd. According to ...
7
by: codinginc | last post by:
Hi Everyone, Is it possible to insert format specifier in a form of variable. See example below Standard from char result; float fnum = 3.14159; sprintf( result, "%f", fnum );...
3
amarniit
by: amarniit | last post by:
I am making a project on the basis of numbers........here i need that i print a bigger number whose lenght is more than 300 digits....... while i am doing it in C than i am getting a problem my all...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.