第1个回答 2014-12-11
#include<stdio.h>
void main()
{ int a,*p,c;
float b,*q;
p=&a; q=&b; c=3;
printf("Please Input the Value of a, b: "); scanf("%d%f",&a,&b);
printf("Result:\n\t%d, %f\n\t%d, %f\n",(*p),(*q),a,b);
printf("The Address of a, b: %x, %x\nThe Adress of a, b: %x, %x\n",p,q,&a,&b);
p=&c; printf("c=%d\n",(*p));
printf("The Address of c: %x, %x\n",p,&c);
}
第2个回答 2014-12-11
#include <stdio.h>
int main()
{
int a=0;
float b=0;
int *p = &a;
float *q = &b;
int c = 3;
printf("Please Input the Value of a,b:");
scanf("%d %f",p,q);
printf("Resault:\r\n\t%d,%f\r\n",a,b);
printf("\t%d,%f\r\n",*p,*q);
printf("The Address of a,b:%.8x,%.8x\r\n",&a,&b);
printf("The Address of a,b:%.8x,%.8x\r\n",p,q);
p = &c;
printf("c=%d\r\n",*p);
printf("The Address of c:%.8x\r\n",p);
return 0;
}