Awesome q2a theme
0 votes
49 views

can someone please explain the solution? answer is 26.

in Programming by (5 points) | 49 views
+3
*(x+1) is the same as x[1].

However, when you do &x+1, the pointer skips the entire array and points to the first location after the array. So then, when you do *(ptr-1), it is interpreted as ptr[-1], which now points to 6.

(&a) will return a pointer to an array of ints (i.e int (*)[6]) and hence, it has been typecast to (int*).

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
8,998 questions
3,130 answers
14,378 comments
95,816 users