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 are structure types in C?
What is the use of pointers in C?
Explain how do you declare an array that will hold more than 64kb of data?
What is the description for syntax errors?
Describe the steps to insert data into a singly linked list.
What is a node in c?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Describe dynamic data structure in c programming language?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is the difference between functions getch() and getche()?
Does c have enums?
Is anything faster than c?
What is a pointer variable in c language?
Write a program to reverse a given number in c?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"