What\'s wrong with the class itself? What\'s wrong with line 18? What\'s wrong w
ID: 3865785 • Letter: W
Question
What's wrong with the class itself? What's wrong with line 18? What's wrong with line 19? What's wrong with line 20? State True or False for each of the following statements about friend function. i. Friend function is a member function. ii. Friend function is declared, not defined, in a class. iii. Friend function has the right to access the public and private members of the class in which it is declared. iv Friend function is inherited. v. Friend function of a class can be a member function of another class. Write the function header of the default copy constructor for a class called A. Write one default constructor prototype of a class called A. Write a destructor of class B that deletes the object pointed by the pointer ptr. Write the class header of a class called B that use protected inheritance to inherit class J. Write a statement that dynamically create an object of class B;Explanation / Answer
2-
i-Friend function is a member function-False
ii-friend function is declared,not defined in a class-True
iii-Friend function has right to access the public and private members of the class in which it is declared-True.
iv-Friend function is inherited-false.
v-Friend function of a class can be member function of another clas-True.
3-Default copy constructor of class A
A(const A &old_obj);
4-Default constructor of class A
A(){}
5-
~B()
{
if(ptr)
delete ptr;
}
6-class B: protected J
7-B *b=new B();
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.