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
相关推荐
NiceCloud喜云21 小时前
Opus 4.8 的 Effort Control 怎么选:Low 到 Max 五档策略
android·java·大数据·前端·c++·python·spring
cjhbachelor21 小时前
c++继承
c++
GISer_Jing1 天前
Three.js着色器编译机制深度解析
javascript·webgl·着色器
丷丩1 天前
MapLibre GL JS第22课:查看本地GeoJSON
前端·javascript·map·mapbox·maplibre gl js
AI玫瑰助手1 天前
Python函数:默认参数的定义与注意事项
开发语言·python·信息可视化
油炸自行车1 天前
Claude Code 错误:API Error: 400 Failed to deserialize the JSON body into the
开发语言·javascript·json·trae·claude code·api error 400
肩上风骋1 天前
C++14特性
开发语言·c++·c++14特性
JAVA社区1 天前
Java高级全套教程(十)—— SpringCloudAlibaba超详细实战详解
java·开发语言·spring cloud·面试·职场和发展
弥树子1 天前
踩坑记录:服务器内网调用接口,真实请求URL与官方公开URL不一致问题排查
开发语言·php
z落落1 天前
C# ToCharArray + foreach遍历 + String与StringBuilder
开发语言·c#