+ 3
Please
what's the difference between "." and ":" when we call a function in c++?
3 ответов
+ 2
"." is used when we call function in object of a class. "::" is used when we implement the function.
See the example:
class MyClass
{
public:
void MyFunction();
};
void MyClass::MyFunction()
{
.....
}
int main()
{
MyClass object;
object.MyFunction();
return 0;
}