A const object can be accessed by any member function as long as that function i
ID: 3818088 • Letter: A
Question
A const object can be accessed by any member function as long as that function is a member of the same class. a. True b. False The C + + copy constructor is invoked when an object is passed by a pointer to a function. a. True b. False If a programmer does not supply a destructor for the class, then the compiler generates and executes a default one. a. True b. False A friend function has access to its object address using this" pointer a. True b. False Given the following code, what will be printed out given that the assignment operator, in the code below, is the default one? void main () {Array A (5);//Array is the class developed in one of our lab//assignments. + + A; int n = 10; if (n) {Array B(10); B = A; n + +;} A. print();//print out the array object A.} The class X contains two data members: an integer called xVal and a float called xPerc. Which of the following is not a valid prototype for the class definition for X? a. void X(int, float); b. void setx Val(int); c. float getxPerc(); d. void print X(); c. none of the above void X(int, float); is not a valid prototype because only constructors can have the same name as the class and constructors NEVER have a return type.Explanation / Answer
10. Ans: True.
yes, A constant object can be accesses by any member function as long as that function is a member of the same class.
11. Ans: False.
No,the c++ copy constructor is invoked when an object is passes by a pointer to a function because if it's not by reference, it's by value. To do that you make a copy.
12.Ans: True,
Yes, a program that doesn't supply a destructor for the class then the compiler generates and executes a fefalut one.
13. False.
Because Friends are non-member functions hence we do not get using “this” pointer
14. yes it is default one.
15 void setx Val(int);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.