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 two forms of #include directive?
Why #include is used in c language?
What is the sizeof () operator?
What is a ternary operator in c?
Why is a semicolon (;) put at the end of every program statement?
What are enums in c?
What does calloc stand for?
Explain what is the best way to comment out a section of code that contains comments?
In a switch statement, what will happen if a break statement is omitted?
Explain what is meant by 'bit masking'?
Explain the difference between the local variable and global variable in c?
Why do some versions of toupper act strangely if given an upper-case letter?
What is a pointer on a pointer in c programming language?
What is wrong in this statement? scanf(ā%dā,whatnumber);
Explain setjmp()?