C++ is related to the class
We can use it together. In what circumstances are those three used?
c++
:
, .
, ->
operators are double colon
, dot
, and arrow
, respectively
Used to access a class member or class object in C++.
Each of the three has a different situation. If you look at the code
Write when b
is a member of the class/namespace a. In this case, a is the name of the class or namespace
Used only when b is a member of object a. In this case, a is the object of the class.
Usually (*)a.stands for b
. However, ->
can be overloaded, so in this case, it behaves as defined by the person who implemented it.
© 2024 OneMinuteCode. All rights reserved.