What does this mean "::"

for example :

String&&String :: operator = (const String & rhs)

What does this line mean? thank you.
Last edited on
:: shows what namespace you are using, For example:

1
2
3
4
5
6
7
namespace myNameSpace
{
int a;
int b;
}

myNameSpace::a = 12; // I am using a, which is in namespace myNameSpace 


1
2
3
4
5
6
7
8
9
10
class myClass
{
public:
    void myMethod();
};

void myClass::myMethod() // I am defining myMethod member of myClass class
{
..
}
Meaning it is a calling function. I did not understand the second part?
Last edited on
for example
1
2
3
4
5
6
7
8
9
10
11
12
class string
......
Public 
operator int();
operator char *();
};

string :: operator int()
{}

string :: operator char*()
{}


what does this whole program means?
Last edited on
I guess this

1
2
string :: operator int() 
{}


means that the string is changed into an integer and the result is returned. But I'm not sure...
Topic archived. No new replies allowed.