0 0 votes #include<stdio.h> int main() { int a[] = {1, 2, 3, 4, 5, 6}; int *ptr = (int*)(&a+1); printf("%d ", *(ptr-1) ); return 0; } Give the output with explanation. Programming in C programming-in-c pointers output + – Tuhin Dutta 768 views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Shivam Chauhan commented Nov 19, 2017 reply Follow flag output should be 6 0 0 replyShare just_bhavana commented Nov 19, 2017 reply Follow flag yes, when you add 1 to &a, it is displaced by a factor of array size. So,&a + 1 points to next memory location after the array and since ptr is an integer pointer (ptr - 1) points to memory location containing 6 1 1 replyShare Please log in or register to add a comment.
1 1 vote Tuhin Dutta plz, refer here: https://gateoverflow.in/106917/ace-mock-pointers Hira Thakur answered Nov 19, 2017 Hira Thakur comment Share Follow 0 reply Please log in or register to add a comment.