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 header files why are they important?
Why can arithmetic operations not be performed on void pointers?
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
What are the rules for the identifier?
What are the string functions? List some string functions available in c.
Why can't I perform arithmetic on a void* pointer?
Linked lists -- can you tell me how to check whether a linked list is circular?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
Is there sort function in c?
How do you construct an increment statement or decrement statement in C?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
When should a far pointer be used?
What is a pragma?
What is typedef example?
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