例1:输出字符串
#include <stdio.h>
int main ()
{
char a[]="I am a student";
char *q;
q=a;
printf("%s",q);
}
运行结果:
I am a student
--------------------------------
Process exited after 0.2772 seconds with return value 0
请按任意键继续. . .
例2:输出数字
#include <stdio.h>
int main()
{
int a=3,*p;
p=&a;
printf("%d",*p);
}
运行结果:
3
--------------------------------
Process exited after 0.06304 seconds with return value 1
请按任意键继续. . .