Visual Studio之 error C4996 ‘sprintf’

Visual Studio之 error C4996 'sprintf'今日用Visual Studio寫段暴力碰撞運算破解數學問題.用sprintf()將結果輸出命令行.掟C4996錯,語法明明冇錯.源於C4996,警告此類C函式,無安全檢測可能會記憶體越界讀寫.其實問題根本無甘嚴重.最好方法禁用此類錯誤檢測.

#pragma warning(disable:4996)

 

error C4996: ‘sprintf’: This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

 

發表評論