int arr[] = {1,2,3,4}
int *ptr=arr;

*(arr+3) = *++ptr + *ptr++;

Final contents of arr[]

Answer Posted / vijaisankar

In this statement
first ptr holds base address of the array(4000),
then as per precedence operators ptr gets post incremented
(4002)though it points the value 1(4000)(ptr is post
incremented) and then ptr gets preincrement so (4004) the
value in that one is 3 then 3+1=4.
*(arr+3)=3;

Is This Answer Correct ?    2 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is operator precedence?

636


What does typedef struct mean?

645


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1453


Why dont c comments nest?

610


What are the types of data structures in c?

593






To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2177


How to implement a packet in C

2383


Define Spanning-Tree Protocol (STP)

634


how many errors in c explain deply

1621


How can I sort a linked list?

626


How can I do peek and poke in c?

609


What are the string functions? List some string functions available in c.

594


how should functions be apportioned among source files?

616


What is void main () in c?

722


What is table lookup in c?

616