【发布时间】:2011-10-12 02:12:28
【问题描述】:
我正在创建一个需要从用户那里获取三个输入的菜单。
char *fullname;
char *date;
float sal;
printf("\nEnter full name: ");
第92行
scanf("%s", &fullname);
printf("\nEnter hire date: ");
第 94 行
scanf("%s", &date);
printf("\nEnter salary: ");
第 96 行
scanf("%d", &sal);
这些是我收到的错误
Employee.c:92: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char **’
Employee.c:94: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char **’
Employee.c:96: warning: format ‘%d’ expects type ‘int *’, but argument 2 has type ‘float *’
我能否解释导致这些问题的原因?
【问题讨论】: