舉個例子,請思考下列呼叫,它們假設我們的類別定義了列於表 18.1 中的虛擬函式: Bear *pb = new Panda("ying_yang"); pb->print(); // ok:Panda::print() pb->cuddle(); ...
確定! 回上一頁