预测下面程序的输出:// PROGRAM 1#include <stdio.h>int main(void){ int arr[] = {10, 20}; int *p = arr; ++*p; printf("arr[0] = %d, arr[1] = %d, *p = %d", arr[0], arr[1], *p); return 0;}// PROGRAM 2#include <stdio.h>int main(void){ int arr[] = {10, 20}; int *p = arr; *p++; printf("arr[0] = %d, arr[1] = %d, *p = %d", arr[0], arr[1], *p); return 0;}// PROGRAM 3#include <stdio.h>int main(void){ int arr[] = {10, 20}; int *p = arr; *++p; printf("arr[0] = %d, arr[1] = %d, *p = %d", arr[0], arr[1], *p); return 0;}
举一反三
- 若arr=[[]],则可以将arr[1][0]设置为a。()
- 若int[][] arr= {{1,2,3}},则arr[0][1]的结果为( )
- 若int[][]arr={{1,2,3}},则arr[0][1]的结果为 A: 0 B: 1 C: 2 D: 3
- 下列程序的运行结果是( )。var arr=[1,2,3,4,5];arr[0]=0;arr[5]=0;document.write(arr); A: 0,2,3,4,5,0 B: 1,2,3,4,5 C: 0,1,2,3,4,5,0 D: 0,1,2,3,4,5
- 若int[][]arr={{1,2,3}},则arr[0][1]的结果为 A: 0 B: 3.51 C: 3.510 D: 4