1 votes 1 votes Programming in C programming-in-c array + – Sourabh Kumar asked Jun 18, 2017 Sourabh Kumar 607 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes In an array, the memory space is allocated in a contiguous manner. Therefore if we know the address of a[i-1] then can find the address of a[i] by going forward in memory by the size of integer. Hence the answer. shraddha priya answered Jun 18, 2017 shraddha priya comment Share Follow See all 6 Comments See all 6 6 Comments reply Sourabh Kumar commented Jun 18, 2017 reply Follow Share What's wrong with option a. 0 votes 0 votes shraddha priya commented Jun 18, 2017 reply Follow Share In option A, i is being added to the base address of the array. But to go to the ith element's address we should do as follows: x+ size of int*i and not x+i, as we need to skip i-1 elements each of size of integer. 1 votes 1 votes Arnab Bhadra commented Jun 24, 2017 reply Follow Share Option 3 is also correct. 0 votes 0 votes shraddha priya commented Jun 26, 2017 reply Follow Share Option 3 is correct only when the indexing of array starts from 0 but not when it starts from 1. 0 votes 0 votes Arnab Bhadra commented Jun 26, 2017 reply Follow Share Yes, you are right 0 votes 0 votes Hemaxi commented Jul 6, 2017 reply Follow Share But for arrays, indexing does start at 0 .also while storing it's always base address that matters.so why not option 3 0 votes 0 votes Please log in or register to add a comment.