摘要: 1、参数加const:int fun(const int a) a在函数里不可被修改 2、函数前加const:const int* const fun() 这种一般是返回的指针或者是引用,加const是规定返回值不可被修改 3、函数后加const:int fun()const 这个函数不能访问类中所 阅读全文
posted @ 2018-10-12 14:38 朱小勇 阅读(3178) 评论(0) 推荐(0)
摘要: 是释放指针所指向的内存,而不是删除指针本身 阅读全文
posted @ 2018-10-12 11:53 朱小勇 阅读(364) 评论(0) 推荐(0)