选择题:
第1题:
#include<stdio.h>
main()
{
struct node{int a;int b;int c;};
struct node s={5,7,9};
struct node *pt=&s;
printf("%d",*pt);
}
这段程序的输出:
A:5
B: 7
C:
9
D:以上都不正确
第2题:
#include<stdio.h>
main()
{
char p;
char buf[10]={1,2,3,4,5,6,8,9};
p=(buf+1)[5];
printf("%d",p);
}
这段程序的输出:
A:5
B: 6
C:
9
D:以上都不正确
第3题
#include<stdio.h>
int counter(int i)
{
static int count=0;
count=count+i;
return count;
}
main()
{
int i,j;
for(i=0;i<=5;i++)
j=counter(i);
printf("%d",j);
}
这段程序的输出:
A:10
B: 15
C:
6
D: 7
第4题
#include<stdio.h>
void f(char **);
main()
{
char *argv[]={"ab","cd","ef","gh","ij","kl"};
f(argv);
}
void f(char **p)
{
char *t;
t=(p+=sizeof(int))[-1];
printf("%s",t);
}
这段程序的输出:
A:ad
B: cd
C:
ef
D: gh
第5题
#include<stdio.h>
void foo(int [][3]);
main()
{
int a[3][3]={{1,2,3},{4,5,6},{7,8,9}};
foo(a);
printf("%d",a[2][1]);
}
void foo(int b[][3])
{
++b;
b[1][1]=9;
}
这段程序的输出:
A:7
B: 8
C:
9
D:以上都不正确