在VS2017中取消SDL安全检查后,运行程序出现MSB403错误。以下为运行代码:
#define LOCAL
#define INF 1000000000
#include
int main()
{
#ifdef LOCAL
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
int x, count = 0, min = INF, max = -INF, sum = 0;
while (scanf("%d", &x) == 1)
{
sum += x;
if (x < min)min = x;
if (x > max)max = x;
count++;
}
printf("min=%d,max=%d,avearage=%.3f", min, max,(double)sum/count);
return 0;
}
运行错误列表:严重性 代码 说明 项目 文件 行 禁止显示状态
错误 MSB4030 “否”对于“CL”任务的“SDLCheck”参数是无效值。“SDLCheck”参数的类型为“System.Boolean”。 Project2 D:\vs\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 490