刚接触VS2015,在.net3.5 x86下写了个c程序。
#include
int main(void)
{
const int WEEK = 7;
int days, weeks,left;
printf("Please enter the numbers of days.\n");
printf("Enter 0 to quit.\n");
scanf_s("%d", &days):
{
left = days % WEEK;
weeks = days / WEEK;
printf("%d days is %d weeks and %d days left.\n", days, weeks, left);
scanf_s("%d", &days);
};
return 0;
}
第一次正常,第二输入就错误。
0x55FAB0E2 (ucrtbased.dll)处(位于 A5.11.3 days to weeks.exe 中)引发的异常: 0xC0000005: 写入位置 0x00000014 时发生访问冲突。
这种情况是什么问题?