有以下程序: #include<iostream> using namespace std; int n[][3]={10,20,30,40,50,60}; int main() { int (*p)[3]; p=n; cout<<p[0] [0]<<","<<*(p[0]+1)<<","<<(*p) [2]<<end1; return 0; } 上述程序执行后的输出结果是( )。
A.10,20,30
B.20,30,40
C.10,30,50
D.10,40,60
第1题:
以下程序的输出结果是#include "stdio.h"int *fun(int *a,int *b){ int m; m=*a; m+=*b-3; return(&m);}main(){ int x=21,y=35,*a=&x,*b=&y; int *k; k=fun(a,b); printf("%d\n",*k);}
第2题:
以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=&i,*q=&j; swap(p,q);printf("%d %d\n",*p,*q); }
第3题:
【填空题】写出下列程序的输出结果。 #include <iostream> using namespace std; int n[][3] ={10, 20, 30, 40, 50, 60}; int main____ { int____[3]; p = n; cout << p[0][0] << "," << *____ <<"," << ____[2] << endl; return 0; }
第4题:
有以下程序: #include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,&B) ; printf("%d\n",*b+1); } 程序的输出结果是( )
A.2
B.3
C.4
D.5
第5题: