What is virtual class and friend class, C/C++ Programming

Friend classes are used when two or more classes are designed to work together and require access to each other's execution in ways that the rest of the world shouldn't be permitted to have. In other words, they help keep private things private. For instance, it may be desirable for class DatabaseCursor to have more privilege to the internals of class Database than main() has.               

 

 

Posted Date: 4/8/2013 5:43:39 AM | Location : United States







Related Discussions:- What is virtual class and friend class, Assignment Help, Ask Question on What is virtual class and friend class, Get Answer, Expert's Help, What is virtual class and friend class Discussions

Write discussion on What is virtual class and friend class
Your posts are moderated
Related Questions
Class Templates In addition to function  templates, C++  also supports the  method of class templates. By definition, a class template is a class definition that explains a fam

Question A bank normally updates it's clients accounts at the end of each month.Of the two types of bank accounts:savings and checking, a client must maintain a minimum balance

it is a class enclosed in the scope of another class. For illustration: // Example: Nested class // class OuterClass { class NestedClass { // ... }; // .

the issue of oil spills

http://www.expertsmind.com/questions/decodethecode-30110560.aspx


Access privileges 1. If the designer of the base class needs no one, not even a derived class to access a member, then that member should be made private. 2. If the designer

By pressing ‘6’ (i.e. key’6’ one time) on the keypad, the mobile shows ‘m’ on display screen in write text message area

Q-What is your reaction to following line of code?               delete this; A: This is not a good programming Practice. A good programmer will insist that you must absolute

Differences between a pointer and a reference 1.  A reference must always point to some object where as this restriction is not imposed on a pointer. e.g. int *pi = 0;