0
我不斷收到以下錯誤,我不知道什麼是錯四處錯誤:控制到達非void函數的結束不知道爲什麼
cc1plus: warnings being treated as errors
scene.cpp: In member function ‘Image* Scene::getpicture(int) const’:
scene.cpp:179: error: control reaches end of non-void function
這裏是一個錯誤是在代碼的一部分:
Image* Scene::getpicture(int index) const {
if(index<0 || index >maximum)
cout << "invalid index" << endl;
else {
return images[index];
}
}
是'圖像[]'圖像'或'*圖像'數組的數組? –