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
Explain setjmp()?
Why doesnt this code work?
How can I avoid the abort, retry, fail messages?
What is the acronym for ansi?
What is getch?
How can I manipulate individual bits?
Which programming language is best for getting job 2020?
What is a list in c?
Can static variables be declared in a header file?
Explain the use of 'auto' keyword in c programming?
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.
What is exit() function?
Tell me what is null pointer in c?
Why shouldn’t I start variable names with underscores?
What is the difference between strcpy() and memcpy() function in c programming?