JOIN ME:
youtube ►
patreon ►
play list for smart pointers:
play list for STL:
play list for C++14:
play list for Threads In C++:
play list for C++ Interview Questions And Answer:
play list for C++ Tutoria For Beginners:
paly list for Design Patterns:
play list for Linked List Interview Questions:
play list for Data Structures:
play list for Type Casts:
paly list for Sorting Algorithms:
NOTES:
const member function is used to restrict modification of data members inside function.
For more details please watch full video and do let me know if there is any doubts in comment section.
#ConstMemberFunctionCpp #CppTutorial #CppNuts
Tag: const c++, const member function in c++, how to use const member function in c++, what is const member function in c++, c++ tutorial for beginners, const member function, basic programming tutorial, c++ lessons, c++ programming language course, learn c++ programming online, programming, online courses, programming training, online programming courses
Xem thêm: https://icongnghe.org/category/pc
Nguồn: https://icongnghe.org
15 Bình luận. Leave new
Very clear explanation 👍🏻👍🏻
Could you please help with the real-world scenario where we would require to use mutable data members?
Thanks for clear explaination.
Nice video. I don't get why C++ is overcomplicating things so much. There are rules on top of the rules. Is it really necessary to design a language like this?
mu·ta·ble
/ˈmyo͞odəb(ə)l/
https://www.youtube.com/channel/UCVoUouiJy2NJebt8uJX5xhw
👆 Check this link it may help you for c++ programming
when using iniatialization list with a contructor insteam of assoignment in it's body don't you use ":variable(value), variable1(value1)" with parenthesis "()" ? why is he using brackets? "{}"
#include<iostream>
using namespace std;
class Base
{
mutable int x;
public:
Base(int a):x{a}{}
void setX(int z){x=z;}
int getX() const { setX(900); return x;}
};
int main()
{
Base b(50);
cout<< b.getX()<<endl;
return 0;
}
Kindly reply why I am getting compilation… ??
Your videos are really explanatory and all my friends here in New Jersey watch them as a supplement to what we study in c++..Thank you!!! Huge Respect !!!!!!
If you create a local variable in const function ..can you change it once it is initialized
Now it's clear, thanks for the clear definition!
What compiler used in this vedio?please tell.it is looking great
Dude that was damn so clear😀
Can you please tell me, how we can stop inheritance without using final keyword?
Can we override const function?
sir, why you have use" base(int a, int b): x{a},y{b}{} "