g****g 发帖数: 1828 | 1 const int nbins = 13;
double xbin[nbins+1];
for (int i=0;i
xbin[i]= 10.0*i;
here's the message, but the line number is incorrect; it's far from the line
where this array is located.
Limitation: Statement too long FILE:drawRatios4.C LINE:96
cint: Security mode 0x7:0x2 *** Fatal error in interpreter... restarting
interpreter ***
*** Fatal error in interpreter... restarting interpreter *** |
t****t 发帖数: 6806 | 2 no this code snipet is correct.
is this line 96? if not, why don't you show line 96?
line
【在 g****g 的大作中提到】 : const int nbins = 13; : double xbin[nbins+1]; : for (int i=0;i: xbin[i]= 10.0*i; : here's the message, but the line number is incorrect; it's far from the line : where this array is located. : Limitation: Statement too long FILE:drawRatios4.C LINE:96 : cint: Security mode 0x7:0x2 *** Fatal error in interpreter... restarting : interpreter *** : *** Fatal error in interpreter... restarting interpreter ***
|
N***m 发帖数: 4460 | 3 this part is correct
line
【在 g****g 的大作中提到】 : const int nbins = 13; : double xbin[nbins+1]; : for (int i=0;i: xbin[i]= 10.0*i; : here's the message, but the line number is incorrect; it's far from the line : where this array is located. : Limitation: Statement too long FILE:drawRatios4.C LINE:96 : cint: Security mode 0x7:0x2 *** Fatal error in interpreter... restarting : interpreter *** : *** Fatal error in interpreter... restarting interpreter ***
|
g****g 发帖数: 1828 | 4 多谢大家! 我找到了错误的原因。忘了说,上面那段code原来全在global variable的
部分。
我这样做就没问题了,把他们放在不同的地方:
//这部分仍然放在global
const int nbins = 13;
//这部分转移到第一个被调用的function的最前面部分。
//(其实任何用到该array前都可以,我觉得。但放在开头清楚些。)
double xbin[nbins+1];
for (int i=0;i
xbin[i]= 10.0*i; |