分别在Debug和release模式编译的程序区别这么大
wgc 2005-07-07 07:33:49 我的程序代码是
fscanf(rfp,"%d%d%f%s%f%f%f%f%f%f%f%f%f%f%f%f%f%f",
&skp,&station,&freq,comp,&s,&emag,&ephz,&hmag,&hphz,&res,
&phase,&pemag,&sephz,&pHmag,&sHphz,&Rho,&sPhz,&TMARES_SRES);
freq=(float) freqarry[j];
amps=Amps[i][j];
emag=E_mag[i][j];
ephz=E_phz[i][j];
hmag=H_mag[i][j];
hphz=H_phz[i][j];
res=Ressistivity[i][j];
phase=Phase[i][j];
fprintf(wfp,"%d %d %f %s %f %e %f %e %f %e %f %f %f %f %f %f %f %e\n",
skp,station,freq,comp,amps,emag,ephz,hmag,hphz,res,phase,pemag,sephz,pHmag,
sHphz,Rho,sPhz,TMARES_SRES);
源文件是
2 -2 32.00 ExHy 22.0 3.5954E+4 -367.6 5.3420E+1 -291.1 2.8311E+3 -76.5 0.0 0.0 0.4 4.3 0.6 3.0 2.8322E+3
在debug模式下编译的程序正常,
2 -2 32.000000 ExHy 22.000000 3.595400e+004 -367.600006 5.342000e+001 -291.100006 2.831100e+003 -76.500000 0.000000 0.000000 0.400000 4.300000 0.600000 3.000000 2.832200e
在release模式下编译的程序不正常,
2 -2 32.000000 ExHy吞? 22.000000 3.595400e+004 -367.600006 5.342000e+001 -291.100006 2.831100e+003 -76.500000 0.000000 0.000000 0.400000 4.300000 0.600000
为什么会这样?字符串有问题。