C++ Const Member Functions (Const Methods)

Subscribers:
58,800
Published on ● Video Link: https://www.youtube.com/watch?v=OuJrVht_LC0



Duration: 0:00
138 views
10


C++ Object Oriented Programming. C++ Classes and OOP. In the previous video we went over how to define a struct, add class data members, and methods to represent a Fraction. In this video, we go over const methods.
Const member functions, or const methods, ensure that member variables will not change when a method is call. This is also necessary to guarantee to C++ that member variables will not change if an object is passed into a function as const reference. In general, it is good practice to always mark a method as const if it does not change any data member value.

C++ OOP Playlist:
   • C++ Object Oriented Programming  

Beginner C++ Playlist:
   • C++ Programming Tutorial  

Github Repo for C++ OOP Code:
https://github.com/ImKennyYip/cpp-oop

Install C++ with VS Code:
   • How to set up C++ in Visual Studio Code  

Subscribe for more coding tutorials 😄 !

🌟 If you enjoyed the tutorial and would like to support the channel, you can do so here: https://buymeacoffee.com/kennyyipcoding