main()
{
int *ptr=(int*)malloc(sizeof(int));
*ptr=4;
printf("%d",(*ptr)+++*ptr++);
}
Answer Posted / ankit panwar
*ptr++ : it just increments the pointer not the value it is
pointing to..
++*ptr : it increments the value the pointer points to but
not the pointer..
here
(*ptr++) + (++*ptr) = 0 + (4+1) = 5
so the answer will definately be 5
| Is This Answer Correct ? | 2 Yes | 31 No |
Post New Answer View All Answers
What are directives in c?
What is difference between array and structure in c?
Do pointers store the address of value or the actual value of a variable?
Is void a keyword in c?
can we implement multi-threads in c.
write a proram to reverse the string using switch case?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
ATM machine and railway reservation class/object diagram
write a programming in c to find the sum of all elements in an array through function.
What is cohesion and coupling in c?
What is the difference between functions getch() and getche()?
What are reserved words with a programming language?
Explain can static variables be declared in a header file?
What is static memory allocation? Explain
What is the difference between struct and union in C?