我已經聲明爲一個函數:C/C++鑄造成const古怪
int myFunction(const float** ppArr, const int n, const int m);
,當我把它稱爲像這樣:
float** ppArr = new float*[5];
// Some initialization of ppArr
int result = myFunction(ppArr, 5, 128); <<<< Error
和錯誤的是(VS 2008 Express的):
error C2664: 'Test_myFunction.cpp' : cannot convert parameter 1 from 'float **' to 'const float **'
WTF?我正在將float **轉換爲const float **。那可能出什麼問題? :/
編輯:感謝您令人難以置信的快速反應! :)
無法解釋原因 – 2011-03-23 18:21:08
@大衛:其他答案解釋說。我只是懶惰:P – Nawaz 2011-03-23 18:25:28