C++ const functions (const correctness)

preview_player
Показать описание
Covers C++ const functions and const correctness.
Рекомендации по теме
Комментарии
Автор

interesting ! I like your style of your lesson

malaikuangren
Автор

const MAX_VALUE = 10; max_value can not be modified.
void foo() const {
int variable = 2;
cout<<variable<<endl;} You can not modify the value of variable

const Cow cow; The object cow is now const. You can not modify the variables inside the cow object

treasure
Автор

So why do you have to explicitly specify "const" for saySomething() ? Why does it underline it in the first place if you arent modifying anything there? You arent even using mooCount in that function. Why does it have a problem with it?

Duxa_
Автор

Why sound so bored and less caring?
Not really interesting to hear, especially for non native speaker.

nuric
welcome to shbcf.ru