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
Can we declare variable anywhere in c?
Write a program to check armstrong number in c?
Compare and contrast compilers from interpreters.
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Explain how can a program be made to print the name of a source file where an error occurs?
how is the examination pattern?
What is realloc in c?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
Can we declare function inside main?
What is printf () in c?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Why do we use header files in c?
What is the purpose of realloc()?
Explain indirection?