我的功能是以某種方式改變一個數字,我把它傳遞給零,即使我設置了一個任意數字的變量,函數將其更改爲零?
這是怎麼回事?這怎麼可能呢?函數設置號碼本身爲零?
變量在這裏被定義
int count,i,binnumber,*histo,tempmax,tempmin;
float *data,y,temp,binwidth;
tempmin = floor(temp);
binnumber = ceil(sqrt((count-1)));
//out_stream << binnumber << endl;
binwidth = abs(tempmax-tempmin);
binwidth = binwidth/binnumber;
for (int i=0; i<count; i++)
{
data[i] = data[i] - tempmin;
out_stream2 << data[i] << "\n";
}
func.histogram(data ,histo, binwidth, binnumber); //create array for histogram use
int holder = 0;
,這傳遞給這裏的功能,從而改變其零
void DSP1D::histogram(float *data,int *histo, float _binwidth, int _binnumber)
{
binwidth = _binwidth;
cout << "binwidth is: " << binwidth << endl;
binnumber = _binnumber;
for(int i = 0; i < count; i++)
{
binnumber = data[i]/binwidth;
binnumber = binnumber/binwidth ;
//binnumber = floor(binnumber);
//cout << binnumber << "bin one\n" ;
histo[binnumber] = histo[binnumber] + 1 ; //possibly import sorted numberlist and place sorted numbers in appropriate bins
}
}
binwidth是成爲零值的所有的時間和我們使用
cout << "binwidth is: " << binwidth << endl;
檢查值, 請幫忙嗎?
什麼變量變爲零? – 2012-03-29 19:01:27
什麼數字更改爲零? – Chad 2012-03-29 19:02:27
什麼數字變成零? 'binwidth'定義在哪裏?它是全球性的嗎?它是什麼類型? – user1118321 2012-03-29 19:02:41