What are the differences between public, private, and
protected access?

Answer Posted / alka choubey

public:class members are access from the outside the class.
private:class members are access only within the class.
protected:class members can access inside the same package.

Is This Answer Correct ?    29 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are friend classes?

610


Why #include is used?

613


Comment on c++ standard exceptions?

633


What is the use of endl in c++ give an example?

612


What is c++ iterator?

641






How many types of modularization are there in c++?

562


Can static member variables be private?

625


What is setiosflags c++?

526


can any one help to find a specific string between html tags which is changed to a sting.. weather.html looks (for location) is somewhere #include #include #include using namespace std; string find_field(string myPage,string); int main (void) { string page, line, location, temperature; ifstream inputFile("weather.xml"); while(getline(inputFile, line)) { page.append(line); line.erase(); } // Now page is a string that contains the whole xml page // Here you need to write something that finds and // extracts location and temperature from the XML // data in the string page and stores them in // the strings location and temperature respectively location=find_field(page,"location"); temperature=find_field(page,"temp_c"); cout << "Location: "<

1641


What gives the current position of the put pointer?

559


Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes

584


Define the process of error-handling in case of constructor failure?

565


How would perform Pattern Matching in C++?

652


What is private inheritance?

596


what is data encapsulation in C++?

603