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
What is nested structure with example?
What is the purpose of 'register' keyword in c language?
What are the different types of constants?
What does & mean in scanf?
What is string in c language?
Write a program to print ASCII code for a given digit.
Explain #pragma statements.
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
How many parameters should a function have?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is wrong with this declaration?
Why void is used in c?
What are void pointers in c?
What is the newline escape sequence?
What is the mean of function?