+ 1
dot operator
obj.regVar=42; in friend keyword lessons what's that mean? regVar is not a function, how they use dot operator ?
3 ответов
+ 2
you can assign "functions and values " to your objects by dot operator, there is no limit .
+ 1
Basically,
You can use the dot operator for a member variable or function of any struct or class in C++.
For example,
class Foo
{
public:
int test;
};
Foo bar; //We instantiate the class as object
bar.test = 10; //Set the value of "variable test in
//object bar of class Foo" to be 10
+ 1
thanks a lot