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

Explain setjmp()?

661


Why doesnt this code work?

620


How can I avoid the abort, retry, fail messages?

665


What is the acronym for ansi?

636


What is getch?

633






How can I manipulate individual bits?

611


Which programming language is best for getting job 2020?

611


What is a list in c?

623


Can static variables be declared in a header file?

620


Explain the use of 'auto' keyword in c programming?

685


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

1731


What is exit() function?

563


Tell me what is null pointer in c?

617


Why shouldn’t I start variable names with underscores?

628


What is the difference between strcpy() and memcpy() function in c programming?

629