警告について(fscanfとか)
Posted: 2010年9月06日(月) 23:42
/*
f:\猫様\猫様\mein.cpp(275): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(277): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(292): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(297): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(300): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(310): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(366): warning 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.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(371) : 'sprintf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(369): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(371): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(377): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(381): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(384): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
*/
とおそらく使っているすべてのファイル関係に警告が出ているようなのですが何が原因なのかわかりません。
(確認してみましたが難しくて…)
上が長くなってすいません…
こんな感じに使ってます(全部じゃないです)
FILE *fp;
/*画像*/
int map_img[gazou_max];
for(a=0;a<gazou_max;a++){
sprintf(buff,"パコネコゲーム用/map_img/床%d.bmp",a);
map_img[a]=LoadGraph(buff);
}
fp=fopen("パコネコゲーム用/map_データ/マップパラメーター.txt","r");
do{
fscanf(fp,"%d",&a);
if(a!=1000)
fscanf(fp,"%d %d %d %d",
&kakuninn[a][0],
&kakuninn[a][1],
&kakuninn[a][2],
&kakuninn[a][3]);
}while(a!=1000);
fclose(fp);
使い方に問題ありでしょうか?
f:\猫様\猫様\mein.cpp(275): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(277): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(292): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(297): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(300): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(310): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(366): warning 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.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(371) : 'sprintf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(369): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(371): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(377): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(381): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : 'fopen' の宣言を確認してください。
f:\猫様\猫様\mein.cpp(384): warning C4996: 'fscanf': This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(253) : 'fscanf' の宣言を確認してください。
*/
とおそらく使っているすべてのファイル関係に警告が出ているようなのですが何が原因なのかわかりません。
(確認してみましたが難しくて…)
上が長くなってすいません…
こんな感じに使ってます(全部じゃないです)
FILE *fp;
/*画像*/
int map_img[gazou_max];
for(a=0;a<gazou_max;a++){
sprintf(buff,"パコネコゲーム用/map_img/床%d.bmp",a);
map_img[a]=LoadGraph(buff);
}
fp=fopen("パコネコゲーム用/map_データ/マップパラメーター.txt","r");
do{
fscanf(fp,"%d",&a);
if(a!=1000)
fscanf(fp,"%d %d %d %d",
&kakuninn[a][0],
&kakuninn[a][1],
&kakuninn[a][2],
&kakuninn[a][3]);
}while(a!=1000);
fclose(fp);
使い方に問題ありでしょうか?