📄 subject_44425.htm
字号:
<p>
序号:44425 发表者:yxx 发表日期:2003-06-19 17:28:58
<br>主题:CString GetFileTitle() const;中的const代表什么意义?
<br>内容:CString GetFileTitle() const;中的const代表什么意义?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:michael 回复日期:2003-06-19 17:47:16
<br>内容:const<BR>const declaration<BR><BR>member-function const<BR><BR>When modifying a data declaration, the const keyword specifies that the object or variable is not modifiable. When following a member function's parameter list, the const keyword specifies that the function doesn't modify the object for which it is invoked. See Constant Values and Constant Member Functions for more information. Also see volatile and #define. <BR><BR>摘自MSDN
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:platin 回复日期:2003-06-19 20:00:41
<br>内容:// 如果你将一个类方法声明为const,则必须保证该方法不会改变该类的任何一个成员变<BR>// 的值,此其一。<BR>// 编程时应尽可能使用const。对于不改变的成员函数都应该将其声明为const.这样使编<BR>// 译器能帮你发现错误,这比你自己查错要快得多,省事得多。此其二。<BR>// 良好的编程习惯是将尽可能多的方法声明为const。此其三。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -