C++-类与对象总结

const函数声明

  1. 修饰成员函数,不会改变成员变量:
  • a function b const (c){}: in member function means, all member properties in the function cannot be modified.

2.修饰形参,输入参数在函数中不会被更改,提高程序的健壮性:

  • a function b (const c){}: the parameter c cannot be modified in the function
  1. 修饰返回值,返回值不能修改,尤其用在返回值是指针类型的时候:
  • const a function b (c){}: the return value a cannot be modified in the function
相关推荐
阿里嘎多学长13 小时前
2026-09-30 GitHub 热点项目精选
开发语言·程序员·github·代码托管
5008414 小时前
React Native for OpenHarmony 实战:三方库 react-native-device-uptime 的鸿蒙化适配指南
javascript·分布式·react native·react.js·harmonyos
孙启超15 小时前
【AI开发之Rust】第 22 课:一键多平台与工程收尾 —— CI、发布检查与结课
开发语言·后端·rust
admin and root1 天前
「AI安全篇」实战AntiDebug自动化JS逆向加解密MCP
javascript·人工智能·网络安全·自动化·漏洞挖掘·cnvd·src赏金
朔北之忘 Clancy1 天前
2025 CSP-J 第二轮真题解析
c++·青少年编程·题解·noip·csp·信奥赛·noi
longlongzihan1 天前
LeetCode 17电话号码的字母组合:回溯算法(DFS)详解
c++·算法·leetcode·深度优先
落魄实习生1 天前
Agent Scope Java 2.x 系列【7】工具使用
java·开发语言·ai
yolo_guo1 天前
调试mysql延迟与libevent回调实际发送回复时机问题
c++·mysql·libevent
茉莉玫瑰花茶1 天前
GO [ 方法 ]
开发语言·后端·golang
今晚打老虎1 天前
c++之提高A(前缀和)(第三课)
数据结构·c++·算法