Question

What does the "::" function represent in c++? Please describe how it works.

What does the "::" function represent in c++? Please describe how it works.

Homework Answers

Answer #1

In C++ :: is termed as the scope resolution operator. It has the following vert crucial and important functions to perform:

1) It enables a function to be defined outside the class.

We consider the following code snippet:

class MyClass

{

public:

void Demo(); //We declare the function Demo in class

};

void Demo::MyClass();

{

//statements

}

//Here we declared the function Demo outside the main class. This is done using the scope resolution operator.

2) It enables us to access those variables of a class which are declared as static

3) In cases of conflicts, when we have a local and a global variable both having same name, the scope resolution operator distinguishes between them both

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please describe the risk management process and how it works.
Please describe the risk management process and how it works.
a) What does higher cetane number signify? b) How does an air injection system works? c)...
a) What does higher cetane number signify? b) How does an air injection system works? c) What is the main advantage of fuel injection in S.I Engines?
Nitrous oxide in labor How it works and describe what it is
Nitrous oxide in labor How it works and describe what it is
What does a regression line tell us? What does the error represent? (Please type answer)
What does a regression line tell us? What does the error represent? (Please type answer)
Describe how an antenna works
Describe how an antenna works
Describe how a hot pack works, how does a cold pack work? Are these reactions exothermic...
Describe how a hot pack works, how does a cold pack work? Are these reactions exothermic or endothermic? Include a description of the chemicals used in your answer. Post your answer on the appropriate discussion topic. Type the answer will be better for me, thanks! Cold pack- ice pack
how does a transistors works,. that would require talk of insulators and conductors, how to use...
how does a transistors works,. that would require talk of insulators and conductors, how to use electrical signals to represent binary, and find a way to include some math involving ohm's law in series and parallel..
Describe how a fluorescent light works.
Describe how a fluorescent light works.
Briefly describe how the mechanics of LHC and how it works?
Briefly describe how the mechanics of LHC and how it works?
Explain what Hawking radiation is, how it works, and what it does to black holes.
Explain what Hawking radiation is, how it works, and what it does to black holes.