recategorized by
681 views

1 Answer

5 votes
5 votes
In C, when you have a 2D array like `double A[2][3]`, the memory is laid out in a contiguous fashion in row major order. Assuming `sizeof(double)` is 8, let's analyze the memory layout.

Given that `A[0] = 0xFFAA0000`, this means that the starting address of `A` is `0xFFAA0000`. The size of each element in `A` is `sizeof(double)`, which is 8 in this case.

Therefore:
 A[1] would start at the address `0xFFAA0000 + 3 * sizeof(double) = 0xFFAA0000 + 3 * 8 = 0xFFAA0018 (24 in decimal is same as 18 in hex )

So, the correct answer is: 0xFFAA0018
Answer:

Related questions

462
views
2 answers
6 votes
GO Classes asked Feb 5
462 views
What is a statically allocated variable in C programming? A variable allocated at an absolute address in a program's data spaceA variable allocated on the ... allocated on the heapA variable which can NOT be defined as local variable
511
views
2 answers
7 votes
GO Classes asked Feb 5
511 views
On a $64$-bit system, which of the following C expressions is equivalent to the C expression $(x[2]+4)[3]?$ Assume $\mathrm{x}$ is declared as $\textsf{int}\ast \ast \textsf{x}$\ast(( ... $(* \ast(x+2)+7)$
499
views
1 answers
5 votes
GO Classes asked Feb 5
499 views
The provided C code is a version of the C string library function strlen(), which calculates the length of a given string.unsigned int mystrlen(char *c) { unsigned int i = 0; ... i++; return i;while (*(c + i) != '\0') ++i; return i;
525
views
1 answers
4 votes
GO Classes asked Feb 5
525 views
What will be the output of the following C program?#include <stdio.h>void Mickey(int**, int, int);void Mouse(int, int*);int main(){ int a = 2, b = 3, c = 4; int * ... p); return;}void Mouse(int z, int *p){ *p = *p+1; return;}