what is the difference between %d and %*d in c languaga?

Answer Posted / sivakumar

anand and manini your expectations are wrong. because %d
give the original value of the variable and %*d give the
address of the variable.
eg:-
int a=10,b=20;
printf("%d%d",a,b);
printf("%*d%*d",a,b);

result is 10 20 1775 1775
here 1775 is the starting address of the memory allocation
for the integer.a and b having same address because of
contagious memory allocation.

Is This Answer Correct ?    35 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

646


Wt are the Buses in C Language

2740


Why & is used in scanf in c?

609


Why array is used in c?

545


Is null equal to 0 in sql?

638






Why n++ execute faster than n+1 ?

1819


How does selection sort work in c?

609


What is bss in c?

592


Which driver is a pure java driver

981


Is using exit() the same as using return?

666


What are the basic data types associated with c?

803


What is a char c?

580


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

600


Explain setjmp()?

643


How can I manipulate individual bits?

594