已知下列函数定义: fun(int%,int c,int n,int datA){int k; for(k=0;k<m*n;k++) {*b=data; b++;} } 则调用此函数的正确写法是(假设变量a的说明为int a[50])( )。A.fun(*a,4,5,1);B.fun(a,4,5,1);C.fun((int*)a,4,5,1);D.fun(a,4,5,1);
已知下列函数定义: fun(int%,int c,int n,int datA){int k; for(k=0;k<m*n;k++) {*b=data; b++;} } 则调用此函数的正确写法是(假设变量a的说明为int a[50])( )。
A.fun(*a,4,5,1);
B.fun(&a,4,5,1);
C.fun((int*)a,4,5,1);
D.fun(a,4,5,1);
相关考题:
该程序运行的结果是( )。#include#include#define M 100void fun(int m, int *a, int *n){ int i,j=0;for(i=1;i=m;i++)if(i%7==0||i==0)a[j++]=i;*n=j;}main(){ int aa[M],n,k;clrscr();fun(10,aa,n);for(k=0;kif((k+1) ==0)printf("\n");else printf("M",aa[k]);printf("\n");}
现有如下程序段#include "stdio.h"int fun(int k,int *m){if(k%3)*m=k*k;else *m=k/3;}main(){ int (*p)(int,int *),m;p=fun;(*p)(78, m);printf( "%d\n",m);}则程序段的输出结果为A.24B.25C.26D.27
已知下列函数定义 setw(int *b,int m,int n,int dat) { int k; for(k=0;k<m*n,k++) { *b=dat;b++;} } 则调用此函数的正确写法是(假设变量a的说明为int a[50])( )A.setw(*a,5,8,1);B.setw(a,5,8,1);C.setw((int*)a,5,8,1);D.setw(a,5,8,1);
请编写函数void countValue(int *a,int *n),它的功能是:求出1到1000之内能被7或11整除但不能同时被7和11整除的所有整数并存放在数组a中,并通过n返回这些数的个数。注意:部分源程序已给出。请勿改动主函数main()和写函数writeDAT()的内容。试题程序:include<conio.h>include<stdio.h>void countValue(int *a, int *n){}main ( ){int aa[1000],n, k;clrscr();countValue (aa, n);for(k=0;k<n; k++)if((k+1) %10 ==0){printf("%5d",aa[k]);printf("\n");}else printf("%5d",aa[k]);writeDAT();}writeDAT ( ){int aa[1000],n, k;FILE *fp;fp=fopen("out79.dat","w");countValue(aa,n);for(k=0; k<n; k++)if((k+1)%10==0){fprintf(fp,"%5d",aa[k]);fprintf(fp,"\n");}else fprintf (fp,"%5d",aa[k]);fclose(fp);}
以下程序的输出结果是#include conio.h#include stdio.h#define M 100void fun(int m, int *a, int *n){ int i,j=0; for(i=1;i=m;i++) if(i%7==0||i%11==0) a[j++]=i; *n=j;}main(){ int aa[M],n,k; clrscr(); fun(100,aa,n); for(k=0;kn;k++) if((k+1)%20==0)printf("\n"); else printf("%d",aa[k]); printf("\n"); }
有如下程序段#include "stdio.h"void fun(int *a,int *b,int *c,int *d,int *e){ int i,j,k,m; for(i=0;i *a;i++) for(j=0;j *b;j++) for(k=0;k*c;k++) for(m=0;m *d;m++) ++*e;}main(){ int a=10,b=10,c=10,d=10,e=0; fun(a,b,c,d,e); printf("%d\n",e);} 则程序段的输出结果是A.10000 B.1000 C.100 D.0
以下程序的输出结果是#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);}
已知下列函数定义: fun(int*b,int c,intD){int k; for(k=0;k<c*d;k++) {*b=c+d; b++;} } 则调用此函数的正确写法是(假设变量a的说明为int a[10])( )。A.fun(*a,6,14);B.fim(a,6,8);C.fun(a,8,4);D.fun((int)a,8,6);
下列程序的运行结果是includevoid fun(int *a,int *B){int *k;k=a;a=b;b=k;}void m 下列程序的运行结果是 #include<iostream.h> void fun(int *a,int *B) {int *k; k=a;a=b;b=k; } void main( ) {int a=3,b=6,*x=a,*y=b; fun(x,y); cout << a <<" "<< b; }A.63B.36C.编译出错D.0