如下注析行如果没有&会如何?
结构体如下:
struct date
{
int year;
int mouth;
int day;
}mdate;
主程序里得两行代码:
printf("Please inset the date--year to day:");
scanf("%d%d%d",&mdate.year,&mdate.mouth,&mdate.day);//没有&会如何?
除去&运行过一次崩溃了,想知道原因
[解决办法]
scanf中要求给出变量地址,如果给出的是变量名则会出错
这个去看下scanf函数的注意事项就知道了,有必要纠结吗
[解决办法]