好吧,我不是一个非常有经验的 C++ 程序员,但我想知道以下构造函数的参数中下划线的意义是什么?
class floatCoords
{
public:
floatCoords(float _x, float _y, float _width, float _height)
: x(_x), y(_y), width(_width), height(_height)
{
}
float x, y, width, height;
...
没什么特别的。他这样命名只是为了区分成员变量和参数名称。
下划线是 C++ 标识符中的有效字符。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)