Sunday, July 26, 2009

%d in c programming?

what is the meaning of %p in C programming

%d in c programming?
It is for the address of a pointer.
Reply:in %p, p stands for pointer (memory address). Know this importance: pointer is a variable that holds a memory address as its value


this means you are working with (reading %26amp; writing) memory addresses


see the similarity between %i (you knew this) %26amp; %p (new to you)


int i; -- %i works with this int variable i


void *p; -- %p works with this pointer variable p





hope this useful 4 you


i like programming %26amp; want to make friends


my asl: 23, male, Vietnam


e-mail: ktlqai@yahoo.com, ktlqai@gmail.com


languages: C, C++, Java, C#, VB, Access, MS SQL Server, mySQL


my orientation: build a best programming group


send me an e-mail, friend (if you consider me so)
Reply:"%p" is for pointer operations.


cheers.
Reply:Should be the remainder e.g 3%2 Divides 3 by 2 and finds the remainder if any so the result is 1.


15%5 =0


10%3=1


e.t.c





EDIt:


Ooops!! Didnt see the "p" there hehe
Reply:the first answer is very stupid, obviously he has no knowledge on your question......





very stupid......








as for your question................................








%p is used for pointers, they represent addresses......





for example...consider this program.........





#include %26lt;stdio.h%26gt;





main()


{


int a;


int *pa;





a = 421;


pa = %26amp;a





printf("%d", *pa);


printf("%p", pa);





}





now, the output of the first printf is 421, (%d means integer)





the second printf outputs the address of 421, (i.e. 166E)





the address depends on the computer....








get it?...








good luck.......

orchid cactus

No comments:

Post a Comment