39

单选题 39 /71

运行下面这段C语言程序之后,输出在屏幕上的结果是:
#include<stdio.h>
void foobar(int a, int *b, int **c)
{
    int *p = &a;
    *p = 101;
    *c = b;
    b = p;
}

int main()
{
    int a = 1;
    int b = 2;
    int c = 3;
    int *p = &c;
    foobar(a, &b, &p);
    printf("a=%d, b=%d, c=%d, *p=%d\n", a, b, c, *p);
    return (0);
}

参考答案

a=1, b=2, c=3, *p=2
a=101, b=2, c=3, *p=2
a=101, b=101, c=2, *p=3
a=1, b=101, c=2, *p=3