0
main.cc: In function ‘int main()’:
main.cc:10:26: error: cannot convert ‘libraryname::ZlibCompressor’ to ‘libraryname::Compressor*’ in assignment
options.compressors[0] = libraryname::ZlibCompressor();
options
是一個結構,並且compressors
被定義爲:不能在分配 '庫名稱:: ZlibCompressor' 轉換爲 '庫名稱::壓縮機*'(到數組索引)
Compressor* compressors[256];
ZlibCompressor是Compressor的一個子類。
任何想法爲什麼會發生此錯誤?謝謝!