Hi,
I am CPP beginner. While reading one code on net, i found scope resolustion operator used for using function. Till the time i know, if one function declared in class and if it is defined outside of the class we will use (::) operator. like as follows.
class abc
{
void def();
}
void abc:: def ()
{
}
and for using we will write it as
abc.def();
But i didn't understand following thing.
instead of abc.def(); it is written abc::def(); in init function.
why it is used as abc::def()?
I am CPP beginner. While reading one code on net, i found scope resolustion operator used for using function. Till the time i know, if one function declared in class and if it is defined outside of the class we will use (::) operator. like as follows.
class abc
{
void def();
}
void abc:: def ()
{
}
and for using we will write it as
abc.def();
But i didn't understand following thing.
instead of abc.def(); it is written abc::def(); in init function.
why it is used as abc::def()?