retagged by
633 views
0 0 votes
let suppose address of first index of array is n and size of each block of array is u. then the index of second element is a+u.

let suppose the array has m elements.

what will be the address of the third element of another array of same size, if it's address of second last element is (n - u).

1 Answer

0 0 votes

Let x be the base address of second array. 

Give, x + (m - 2) u = n - u

=> x = n - mu + u

Address of 3rd element = x + 2u => n - (m - 3)*u

Position:
Show:

Related questions

3 3 votes
2 answers 2 answers
2.6k
2.6k views
pawan kumarln asked Jul 29, 2017
2,551 views
a)why base address of array can not be change but string constant base address can be change???b)why content of array can be change but string constant content can not be...
0 0 votes
1 1 answer
573
573 views
bunty choudhary asked Dec 16, 2018
573 views
if array declared size is larger than values initialised. Then what value rest memory elements have , 0 or garbage?
5 5 votes
2 2 answers
291
291 views
GO Classes asked Jun 30
291 views
What is the output of the following code?#include <stdio.h struct Book { char name[4]; int pages; }; int main() { struct Book b1 = {"CAT", 50}; struct Book b2; b2 = b1; b...
5 5 votes
2 2 answers
298
298 views
GO Classes asked Jun 29
298 views
What is the output of the following code?#include <stdio.h struct Student { int roll; int marks; }; int main() { struct Student s[3] = { {1, 70}, {2, 80}, {3, 90} }; s .m...