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 10 different models of writing an addition program in C language?
What is dynamic variable in c?
How do you redirect a standard stream?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is meant by realloc()?
How many loops are there in c?
What are the different types of endless loops?
what do you mean by enumeration constant?
Why do we use int main instead of void main in c?
a c code by using memory allocation for add ,multiply of sprase matrixes
How is a null pointer different from a dangling pointer?
Why flag is used in c?
How do you determine whether to use a stream function or a low-level function?
What is non linear data structure in c?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff