dis_chapter_quiz1 Flashcards
The primary role of the constructors is to initialize the data members of objects (either with default values or with values provided as arguments).
true
int a[4] = {7,5,3,1};
Given the array definition above, which of the following prints 7 as the output?
cout «_space;*a «_space;endl;
Function overloading is not permitted in C++.
False
In C++, process of deallocating memory is handled automatically by the garbage collector. Therefore, unused memory locations are returned to the heap automatically for later allocations.
False
An object can access its public members by using the dot operator (.).
True
Data members of the classes normally placed in “public:” section of a class.
False
Most C++ compilers check whether array indices are out of range.
False
Which of the following is the subscript operator in C++ to access the elements of an array?
[ ]
Procedural programming paradigm focuses on the verbs of a problem’s specification whereas object-oriented programming paradigm focuses on its nouns.
True
n C++, all elements of an array have same data type.
True
Which of the following function can be used to check whether there is more data to be read from an input file stream or not?
eof
Given a string s having more than 4 characters, s[3] and s.at(3) returns the same character.
True
When the capacity of a vector is full, push_back() function adds the element by removing the first element
False
When the capacity of a vector is full, push_back() function adds the element by removing the first element
False
Which of the following classes should be used to print output to a file?
ofstream