#G086. GESP level4 二维及多维数组

GESP level4 二维及多维数组

GESP level4 - 二维及多维数组

  1. 对二维数组int arr[3][16];,则arr[1]占用内存的大小为( )字节。 {{ select(1) }}
  • 4
  • 16
  • 48
  • 64
  1. 对二维数组int arr[3][16];,若arr的地址是0x28cbc0,则arr[1]的值是( )。 {{ select(2) }}
  • 0x28cbc4
  • 0x28cbd0
  • 0x28cc00
  • 不确定
  1. 假设int arr[2][3] = {{1,2,3},{4,5,6}}; ,则arr[1][2]的值是( )。 {{ select(3) }}
  • 2
  • 3
  • 5
  • 6
  1. 下面( )正确定义了二维数组。 {{ select(4) }}
  • int arr[3,4];
  • int arr[3][4];
  • int arr(3,4);
  • int a[3 - 4];
  1. 如果有如下二维数组定义,则a[0][3]的值为( )。int a[2][2] = {{0, 1}, {2, 3}}; {{ select(5) }}
  • 编译出错
  • 1
  • 3
  • 0
  1. 以下哪个选项能正确访问二维数组array的元素( )。 {{ select(6) }}
  • array[1, 2]
  • array(1)(2)
  • array[1][2]
  • array{1}{2}
  1. 一个二维数组定义为char array[3][10];,则这个二维数组占用内存的大小为( )。 {{ select(7) }}
  • 10
  • 30
  • 32
  • 48
  1. 一个三维数组定义为long long array[6][6][6];,则array[1][2][3]和array[3][2][1]在内存中的位置相差多少字节?( ) {{ select(8) }}
  • 70字节
  • 198字节
  • 560字节
  • 无法确定
  1. 下列关于C++语言中数组的叙述,不正确的是( )。 {{ select(9) }}
  • 一维数组可以用来表示数列
  • 二维数组可以用来表示矩阵
  • 三维数组可以用来表示空间中物体的形状
  • 世界是三维的,所以定义四维数组没有意义
  1. 下列关于C++语言中数组的叙述,不正确的是( )。 {{ select(10) }}
  • 一维数组在内存中一定是连续存放的
  • 二维数组是一维数组的一维数组
  • 二维数组中的每个一维数组在内存中都是连续存放的
  • 二维数组在内存中可以不是连续存放的
  1. 一个二维数组定义为double array[3][10];,则这个二维数组占用内存的大小为( )。 {{ select(11) }}
  • 30
  • 60
  • 120
  • 240
  1. 一个二维数组定义为int array[5][3];,则array[1][2]和array[2][1]在内存中的位置相差多少字节?( ) {{ select(12) }}
  • 2字节
  • 4字节
  • 8字节
  • 无法确定
  1. 以下哪个函数声明在调用时可以传递二维数组的名字作为参数?( ) {{ select(13) }}
  • void BubbleSort(int a[][4]);
  • void BubbleSort(int a[3][]);
  • void BubbleSort(int a[][]);
  • void BubbleSort(int ** a);
  1. 在C++中,( )正确声明了一个3行4列的二维数组。 {{ select(14) }}
  • int arr[3, 4];
  • int arr[3][4];
  • int arr[4][3];
  • int arr(3, 4);
  1. 定义数组int a[2024][3][16]={2, 0, 2, 4, 3, 1, 6},则cout << a[2023][2][15]的结果不确定。( ) {{ select(15) }}
  • 对
  • 错
  1. 如果希望记录10个最长为99字节的字符串,可以将字符串数组定义为char s[10][100]; 。( ) {{ select(16) }}
  • 对
  • 错
  1. 如果希望记录10个最长为99字节的字符串,可以将字符串数组定义为char s(10)(100); 。( ) {{ select(17) }}
  • 对
  • 错