设有如下所示的的关于书籍类的一个定义:
Class CBooks
{
Private:
char*p_title;
float price;
public:
CBooks ();
CBooks (char* p_book_title,float book_price);
void setPrice (float book_price);
void print () const;
~CBook ();
};
为使用户能修改书的书名,在CBooks 类中增加一个成员函数setTitle() .若该函数定义成如下两种形式之一,试说明const关键字在这里的用途。
1:void setTitle (char* p_book_title)const;
2:void srtTitle (const char* p_book_title);