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


Please Help Members By Posting Answers For Below Questions

What are the two forms of #include directive?

630


Why #include is used in c language?

580


What is the sizeof () operator?

610


What is a ternary operator in c?

636


Why is a semicolon (;) put at the end of every program statement?

609






What are enums in c?

645


What does calloc stand for?

633


Explain what is the best way to comment out a section of code that contains comments?

706


In a switch statement, what will happen if a break statement is omitted?

594


Explain what is meant by 'bit masking'?

634


Explain the difference between the local variable and global variable in c?

585


Why do some versions of toupper act strangely if given an upper-case letter?

622


What is a pointer on a pointer in c programming language?

605


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

713


Explain setjmp()?

640