有以下程序
#include <stdio.h>
2023-11-03C语言开发工程师
有以下程序
#include <stdio.h>
Main()
{ int n, *p=NULL;
*p=&n;
Printf("Input n:");
Scanf("%d",&p);
Printf("output n:");
Printf("%d\n",p);
}
该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是______。
A.int n , *p=NULL;
B.*p=&n;
C.scanf("%d",&p)
D.printf("%d\n",p);
正确答案是A
有以下程序
#include <stdio.h>
Main()
{ int n, *p=NULL;
*p=&n;
Printf("Input n:");
Scanf("%d",&p);
Printf("output n:");
Printf("%d\n",p);
}
该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是______。
A.int n , *p=NULL;
B.*p=&n;
C.scanf("%d",&p)
D.printf("%d\n",p);
正确答案是A
