📜  门| Gate IT 2008 |第50章

📅  最后修改于: 2021-07-02 15:55:28             🧑  作者: Mango

C程序如下:

# include 
int main ()
{
        int i, j;
        char a [2] [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}};
        char b [3] [2];
        char *p = *b;
        for (i = 0; i < 2; i++) {
              for (j = 0; j < 3; j++) {
              *(p + 2*j + i) = a [i] [j];
              }
        }
}
 /* Add code here. Remove these lines if not writing code */ 

程序末尾的数组b的内容应该是什么?
(A)绝对
光盘
ef
(B)广告

cf
(C)交流
eb
df
(D) AE
直流电
bf答案: (B)
说明: * p = a [0] [0]
*(p + 2)= a [0] [1]
*(p + 4)= a [0] [2]
*(p + 1)= a [1] [0]
*(p + 3)= a [1] [1]
*(p + 5)= a [1] [2]

这个问题的测验