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
Explain bit masking in c?
What is memory leak in c?
What does %d do?
Difference between MAC vs. IP Addressing
How can I automatically locate a programs configuration files in the same directory as the executable?
How would you obtain the current time and difference between two times?
Why can arithmetic operations not be performed on void pointers?
What are the 4 types of organizational structures?
When should you not use a type cast?
Explain what is a static function?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What is array in c with example?
What is main function in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What is c variable?