Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How would you stop a class from class from being derived or
inherited?The constructer should not be Private,as object
instantiation should be allowed.

Answer Posted / kamna

class A;//forward decleration
class B
{
B();
public:
friend A;
}
class A:public virtual B
{
public:
A()
};
class C:public A
{
public:
C()
};

int main()
{
A a; // allowed
C c;//not allowed
return 0;
}

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static in c++?

1100


What is the use of vtable?

1194


What are c++ manipulators?

1122


What do you mean by function and operator overloading in c++?

1111


Is empty stack c++?

1060


What are member functions used in c++?

1210


What is the hardest coding language to learn?

1088


What is a virtual destructor? Explain the use of it?

1033


What is fflush c++?

1078


Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?

1131


What is a c++ vector?

1122


Is c++ a pure oop language?

1123


What is the function to call to turn an ascii string into a long?

1122


Explain one-definition rule (odr).

1172


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

1191