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
Where define directive used?
What is local and global variable in c?
What is wrong with this initialization?
Explain setjmp()?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
What is calloc in c?
Why c is a procedural language?
write a program to generate address labels using structures?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
difference between Low, Middle, High Level languages in c ?
How do we open a binary file in Read/Write mode in C?
What is hashing in c language?
What is a node in c?
What does sizeof function do?
Why use int main instead of void main?