美文网首页
const函数

const函数

作者: 动感新势力fan | 来源:发表于2017-07-07 16:47 被阅读4次

const A *a = new A();
a->getText(); a不能调用普通成员函数
只能调用const修饰的函数 在末尾修饰的

B *b = new B();
不是const 修饰的也能调用const修饰的函数 在末尾修饰

相关文章

网友评论

      本文标题:const函数

      本文链接:https://www.haomeiwen.com/subject/fgcrhxtx.html