int arr[] = {1,2,3,4}
int *ptr=arr;
*(arr+3) = *++ptr + *ptr++;
Final contents of arr[]
Answer Posted / jai
{1,2,3,4}
++ has higher precedence over *, assigment will resolve to
*(arr+3) = *(++ptr) + *(ptr++);
*(arr+3) = 2 + 2;
=> Though ptr is pointing to address of 3rd element after
post increment.
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
What are the usage of pointer in c?
In which language linux is written?
What is the difference between malloc() and calloc()?
What is the purpose of the preprocessor directive error?
What is the use of pragma in embedded c?
What is the advantage of c?
How do you list a file’s date and time?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What does c mean?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
What is sizeof int?
Write a program for finding factorial of a number.
show how link list can be used to repersent the following polynomial i) 5x+2
Explain what is page thrashing?
What is a wrapper function in c?