Question

In: Computer Science

For a given two-dimensional array in C as follows (Each int-type element occupies 4 bytes of...

For a given two-dimensional array in C as follows (Each int-type element occupies 4 bytes of memory)

int A[8][16]; 

If the address of A[1][4] is 0x0FFA0040, what is the memory address of A[2][6]?

Solutions

Expert Solution

A[1][4] is 0x0FFA0040 our address starts from here Each int-type element occupies 4 bytes of memory so we hace to add 4 bytes conitues untill reach A[2][6]
A[1][5] is 0x0FFA0044 add 4 bytes we get this
A[1][6] is 0x0FFA0048 add 4 bytes we get this
A[1][7] is 0x0FFA004c now add 4 bytes to 8 it will 12 in decimal but here address in hex so it is C
A[1][8] is 0x0FFA0050
A[1][9] is 0x0FFA0054
A[1][10] is 0x0FFA0058
A[1][11] is 0x0FFA005c
A[1][12] is 0x0FFA0060
A[1][13] is 0x0FFA0064
A[1][14] is 0x0FFA0068
A[1][15] is 0x0FFA006c
A[2][0] is 0x0FFA0070
A[2][1] is 0x0FFA0074
A[2][2] is 0x0FFA0078
A[2][3] is 0x0FFA007c
A[2][4] is 0x0FFA0080
A[2][5] is 0x0FFA0084
A[2][6] is 0x0FFA008c

//if we do this continues we will reach our desied location whose address is 0x0FFA008c


If you have any query regarding the answer please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.


Related Solutions

Ceate a two dimensional array of int type to hold scores (on a scale of 0...
Ceate a two dimensional array of int type to hold scores (on a scale of 0 to 100) for 10 students (row) for 3 courses (columns) and initialize the array with your preferred data. All the students get 10 bonus points for course #2 (index 1) . Use for a loop to add the bonus points. c programming language
How to create a two-dimensional array, initializing elements in the array and access an element in...
How to create a two-dimensional array, initializing elements in the array and access an element in the array using PHP, C# and Python? Provide code examples for each of these programming languages. [10pt] PHP C# Python Create a two-dimensional array Initializing elements in the array Access an element in the array
Given that Sale[NUM_ROW][NUM_COLUMN] is a two dimensional array of float- point type and the two constants...
Given that Sale[NUM_ROW][NUM_COLUMN] is a two dimensional array of float- point type and the two constants are defined as follows: #define NUM_ROW 4 #define NUM_COLUMN 4 float Value[NUM_ROW][NUM_COLUMN] = { 2.1, 2.2, 2.3, 2.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.1, 2.2, 2.3, 2.4 }; Write a C++ main function that computes and prints out the following information about this 2d array: (1) The mean of all the Value[][] array elements (0.5 points). (2) The median of all...
Multidimensional Arrays Design a C program which uses two two-dimensional arrays as follows: - an array...
Multidimensional Arrays Design a C program which uses two two-dimensional arrays as follows: - an array which can store up to 50 student names where a name is up to 25 characters long - an array which can store marks for 5 courses for up to 50 students The program should first obtain student names and their corresponding marks for a requested number of students from the user. Please note that the program should reject any number of students that...
Multidimensional Arrays Design a C program which uses two two-dimensional arrays as follows: - an array...
Multidimensional Arrays Design a C program which uses two two-dimensional arrays as follows: - an array which can store up to 50 student names where a name is up to 25 characters long - an array which can store marks for 5 courses for up to 50 students The program should first obtain student names and their corresponding marks for a requested number of students from the user. Please note that the program should reject any number of students that...
C++ ASSIGNMENT: Two-dimensional array Problem Write a program that create a two-dimensional array initialized with test...
C++ ASSIGNMENT: Two-dimensional array Problem Write a program that create a two-dimensional array initialized with test data. The program should have the following functions: getTotal - This function should accept two-dimensional array as its argument and return the total of all the values in the array. getAverage - This function should accept a two-dimensional array as its argument and return the average of values in the array. getRowTotal - This function should accept a two-dimensional array as its first argument...
in java Implement a function print2Darray(int[][] array) to print a formatted 4x4 two dimensional integer array....
in java Implement a function print2Darray(int[][] array) to print a formatted 4x4 two dimensional integer array. When the array contains {{10, 15, 30, 40},{15, 5, 8, 2}, {20, 2, 4, 2},{1, 4, 5, 0}}, Your output should look like: {10 15 30 40} {15 5 8 2}{ 20 2 4 2}{ 1450} Now, implement another function print2DList(ArrayList<ArrayList<Integer>> list) to print a formatted 2D list.
For c++ Write the code to initialize an array such that each element gets two times...
For c++ Write the code to initialize an array such that each element gets two times the value of its index (e.g. 0, 2, 4, 6, …)
6 C++ Questions: 19. Assuming an int is size 4 bytes, what is the size in...
6 C++ Questions: 19. Assuming an int is size 4 bytes, what is the size in memory of the below array: int cards[10] = {7, 4, 7, 5, 7}; 20. In the array from question 19, what is the value of the below elements: cards[1]; cards[8]; Assume you have an array with 128 integers which is sorted from lowest to highest. 21a. You are searching for a value which is contained in the array using the binary search algorithm. What...
(In C language) Given a two-dimensional char array, how do I encode it into a one...
(In C language) Given a two-dimensional char array, how do I encode it into a one dimensional integer array? For example: char arr [8][8] = {{1,1,1,1,1,1,1,1}, {1,0,0,0,1,0,0,1}, {1,0,1,0,1,1,0,1}, {1,0,1,0,0,0,0,1}, {1,0,1,1,1,1,0,1}, {1,0,0,0,0,0,0,1}, {1,0,1,0,1,0,1,1}, {1,1,1,1,1,1,1,1}} into int arr2 [8] I know this problem requires bit-shifting but I am unsure how. It also needs to be as efficient as possible. Thanks!
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT