我正在使用EasyBMP庫。該庫有一個方法:訪問成員函數時遇到問題
int red = image(i, j)->Red;
// Gets the value stored in the red channel at coordinates (i, j) of the BMP named image and stores it into the int named red.
下面是我的代碼:
int red = images[i](x, y)->Red;
//圖像是一個動態數組,我使用了一個for循環這裏
圖像是一個成員變量這一聲明的類:
Image **images;
我得到的錯誤是:
scene.cpp:195: error: ‘*(((Image**)((const Scene*)this)->Scene::images) + ((Image**)(((long unsigned int)i) * 8ul)))’ cannot be used as a function
然而,這工作得很好,但我不知道爲什麼上面不工作:
images[i]->TellWidth() //gets the width of the image
我明白的地方其混錯,但我不知道如何解決它。有任何想法嗎?
還沒有得到同樣的錯誤,這 – iRobot 2011-02-05 03:01:50
和編輯後?`(*(images [i]))(x,y) - > Red` – 2011-02-05 03:06:39