類別中宣告為const 的成員函數不能修改成員變數的值,舉例如下 #include <iostream> class Demo { public: Demo(int pa, int pb) { a = pa; b = pb; } int get_sum() ...
確定! 回上一頁