0 votes 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 asked Nov 19, 2017 Tuhin Dutta 398 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Shivam Chauhan commented Nov 19, 2017 reply Follow Share output should be 6 0 votes 0 votes just_bhavana commented Nov 19, 2017 reply Follow Share 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 votes 1 votes Please log in or register to add a comment.
1 votes 1 votes Tuhin Dutta plz, refer here: https://gateoverflow.in/106917/ace-mock-pointers Hira Thakur answered Nov 19, 2017 Hira Thakur comment Share Follow See all 0 reply Please log in or register to add a comment.