error C4996:'fopen':This function or variable may be unsafe.
来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/03/29 09:48:01
error 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.
//假设b=3m,h=100m,ms=2.89 a为板状体倾角 ,is为有效磁化倾角
//#define _CRT_SECURE_NO_WARNINGS
#include
#include
void main()
{
\x09FILE *fp1,*fp2;
\x09fp1 = fopen("H:\\c程序\\试试\\za.txt","w+");
\x09fp2 = fopen("H:\\\c程序\\试试\\ha.txt","w+");
\x09double u;
\x09u = 12.56* pow(10,-7);
\x09float za[50],ha[50],a,is,r;
\x09int b,h,x;
\x09b = 3;
\x09h = 100;
\x09float ms = 2.89;
\x09printf("输入倾角a和磁化角is:\n");
\x09scanf("%d,%d",&a,&is);
\x09a = a*3.14 / 180;
\x09is = is*3.14 / 180;
\x09r = a - is;
\x09for (x = -100; x < 100; x += 5)
\x09{
\x09\x09za[x] = (u / 2 * 3.14) * 2 * b*ms*sin(a)*(h*cos(r) - x*sin(r)) / (x*x + h*h);
\x09\x09ha[x] = (u / 2 * 3.14) * (-2) * b*ms*sin(a)*(h*sin(r) + x*cos(r)) / (x*x + h*h);
\x09\x09fprintf(fp1,"%d %f\n",x,za[x]);
\x09\x09fprintf(fp2,"%d %f\n",x,ha[x]);
\x09}
\x09fclose(fp1);
\x09fclose(fp2);
}
//假设b=3m,h=100m,ms=2.89 a为板状体倾角 ,is为有效磁化倾角
//#define _CRT_SECURE_NO_WARNINGS
#include
#include
void main()
{
\x09FILE *fp1,*fp2;
\x09fp1 = fopen("H:\\c程序\\试试\\za.txt","w+");
\x09fp2 = fopen("H:\\\c程序\\试试\\ha.txt","w+");
\x09double u;
\x09u = 12.56* pow(10,-7);
\x09float za[50],ha[50],a,is,r;
\x09int b,h,x;
\x09b = 3;
\x09h = 100;
\x09float ms = 2.89;
\x09printf("输入倾角a和磁化角is:\n");
\x09scanf("%d,%d",&a,&is);
\x09a = a*3.14 / 180;
\x09is = is*3.14 / 180;
\x09r = a - is;
\x09for (x = -100; x < 100; x += 5)
\x09{
\x09\x09za[x] = (u / 2 * 3.14) * 2 * b*ms*sin(a)*(h*cos(r) - x*sin(r)) / (x*x + h*h);
\x09\x09ha[x] = (u / 2 * 3.14) * (-2) * b*ms*sin(a)*(h*sin(r) + x*cos(r)) / (x*x + h*h);
\x09\x09fprintf(fp1,"%d %f\n",x,za[x]);
\x09\x09fprintf(fp2,"%d %f\n",x,ha[x]);
\x09}
\x09fclose(fp1);
\x09fclose(fp2);
}
你用的是VS2012吧= =.2012开始就对很多函数进行重写,因为微软觉得以前的函数不安全.fopen被fopen_s代替了.
error C4996:'fopen':This function or variable may be unsafe.
warning C4996:'scanf':This function or variable may be unsaf
c(7) :warning C4996:'gets':This function or variable may b v
matlab中Error:Missing variable or function.
matlab Error:Missing variable or function.哪里错了?
matlab Error:Missing variable or function.请大家帮我看看
may be used unintialized in this function啥意思
matlab:Error:Function definitions are not permitted in this
用MATLAB求函数极限时出现 Undefined function or variable "x".
每次打开excel都会出现run-time error‘91’object variable or with block
每次打开Word2007都出现Run-time error '91' Object variable or with b
this could be a temporary problem or your phone may not be p