FUNCTIONS, CONSTRUCTOR, DESTRUCTOR & OVERLOADING QUESTIONS IN C++. (4)

Answer the following questions (i) and (ii) after going through the following class:

class Science
{
char Topic[20];
int Weightage;
public:
Science(); //Function1
{
strcpy(Topic,"Optics");
Weightage = 30;
cout<<"Topic Activated";
}
~ Science() //Function2
{
cout<<"Topic Deactivated";
}
};

(i) Name the specific features of class shown by Function1 and Function2 in the above example.
(ii) How would Function1 and Function2 get executed?



No comments

Post your comments

Powered by Blogger.