作者ric2k1 (Ric)
看板EE_DSnP
标题Re: [问题] 关於作业七
时间Sat Dec 8 23:47:27 2007
※ 引述《Knossos ()》之铭言:
: 标题: [问题] 关於作业七
: 时间: Sat Dec 8 21:15:28 2007
:
: 作业七有出现size_t,那是什麽型态?
:
: 另外就是有的member fuction prototype後面有加上const,是什麽意思呢?
:
: --
:
※ 发信站: 批踢踢实业坊(ptt.cc)
: ◆ From: 61.229.33.79
: 推 lionel20002:非负整数 12/08 22:32
Yes.
: → lionel20002:後面加上const则此函数不能修改datamember 12/08 22:33
: → lionel20002:另外只能呼叫同样是後面将上const的函数 12/08 22:33
A member function:
class A
{
void f() const;
};
says that when the member funtion f() is called by a class A's object,
this object will be treated as "const" object. That is, it can not modify
the class' data members.
We will cover this in the next lecture.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.134.54