指针
源代码:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int x=8;
int *p; //指针变量前面加一个*
p=&x; //p是地址,&x是地址;指针即是地址
printf("%d",x);
printf("\n"); //换行
printf("%d",*p);
system("pause");
}
源代码:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int x=8;
int *p; //指针变量前面加一个*
p=&x; //p是地址,&x是地址;指针即是地址
printf("%d",x);
printf("\n"); //换行
printf("%d",*p);
system("pause");
}