C++ 11 (a) The concept of a class is central to Object-Oriented Programming TRUE
ID: 3910902 • Letter: C
Question
C++ 11
(a) The concept of a class is central to Object-Oriented Programming TRUE FALSE b) A private member variable of a class cannot be accessed directly by name from a pri- vate member function of the same class; instead a public member accessor function TRUE FALSE must be used. (c) When returning a class object by value, in almost all cases, it is important to return the TRUE FALSE object as a const value (d) In a static member function, you may not use the this parameter. TRUE FALSE (e) All operator overloads of a class must return an object of the class type, either by value TRUE FALSE or by reference (f) A C-string can be initialized using a text literal after it has been declared. Example: char str[10]; str-"abc"; TRUE FALSE (g) A string object can be initialized using a text literal after it has been declared. Example: std::string str; str-"abc"; TRUE FALSE (h) An array of type char is a C-string. TRUE FALSE ()Inline functions are always more efficient than non-inline functions. TRUE FALSE ) A class is required to have both member variables and member functions. TRUE FALSEExplanation / Answer
a) TRUE , because objects are central to OOP.
b) FALSE, in the same class it can be accessed.
c) FALSE , it is not necessary in C++11 you can use reference qualifiers.
d) TRUE, you can't use use this parameter.
e)TRUE, For operator overloading to work, at least one of the operands must be a user defined class object.
f)FALSE, This won't work as it is a C-string
g)TRUE, This will work fine.
h)TRUE
i) FALSE, small functions and functions which are called frequently should be inline otherwise they should be non-inline.
j)FALSE
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.