Technical Interview Questions and Answers :: C++
11 / 187
No Discussion on this question yet!
12 / 187
No Discussion on this question yet!
13 / 187
No Discussion on this question yet!
14 / 187
No Discussion on this question yet!
15 / 187
No Discussion on this question yet!
16 / 187
No Discussion on this question yet!
17 / 187
The :: operator links a class name with a member name in order to tell the complier what class the member belongs to. It has another use that is it can allow access to a name in an enclosing scope that is hidden by a local declaration of the same name.
Egname.
Eg:
Void f()
{
int I;
I=10;
………..
……..
}
It may do so by preceding the I with the :: as shown here
Void f()
{
int I;
:: I=10;
……..
……..
}
18 / 187
No Discussion on this question yet!
19 / 187
No Discussion on this question yet!
20 / 187
. Dot operator is used for accessing class members,
-> operator used for accessing pointer in the class