作者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