#include<stdio.h>
int main()
{
int a;
char c;
int *A=&a;
char *C=&c;
printf("Enter the value of a,c\n");
scanf("%d,%d",&a,&c);
printf ("Adress of a,c= %d,%d\n",A,C);
printf("value of a,c= %d %d\n",a,c);
return 0;
}
输出为:
c:\ Users \ Avinash \ Desktop> a.exe
输入a,c的值
12,40
a,c的地址= 6356740,6356739
a,c的值= 0,40
%c
进行扫描char
。改变
scanf("%d,%d",&a,&c);
至
scanf("%d,%c",&a,&c); //make sure there is only single comma in between the inputs. Nothing else, nothing more.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句