CS201 Quiz Introduction to Programming C++ [5]
The declarator of Plus (+) member operator function is ► Class-Name operator + (Class-Name rhs)
► operator Class-Name + ( )
► operator Class-Name + ( rhs)
► Class-Name operator + ( )
What will be the range of numbers generated by function rand () % 9? ► 0 to 9
► 1 to 9
► 0 to 8
► 1 to 8
Which of the following is the correct function call having array named student of 10 elements as a parameter. ► addRecord(student[]) ;
► addRecord(student) ;
► addRecord(student[10]) ;
► addRecord(*student) ;
Declaring structures does not mean that memory is allocated. ► True
► False
Identifier is a name that can be given to variables, labels and functions. ► True
► False
If a class A declares itself a friend of class B and a class B declares itself a friend of class C then ► Class A is also a friend of class C.
► Class B is also a friend of class A.
► Class A is also a friend of class C if A declares C as its friend.
► Class A is also a friend of class C if C declares A as its friend.
Which of the following statement is best regarding declaration of friend function? ► Friend function must be declared after public keyword.
► Friend function must be declared after private keyword.
► Friend function must be declared at the top within class definition.
► It can be declared anywhere in class as these are not affected by the public and
private keywords.
A pointer is a special type of variable that contain ___________ ► Memory Address
► Data values
► Both Values and Memory
► None of given of options
When memory for a program is allocated at run time then it is called ________ ► static memory allocation
► dynamic memory allocation
► stack memory allocation
► virtual memory allocation
What purpose do classes serve? ► Data encapsulation
► Providing a convenient way of modeling real-world objects
► Simplifying code reuse
► All of the given options
Which of the following function cannot be overloaded? ► Member functions
► Utility functions
► Constructor
► Destructor
The following prototype of unary operator function indicates that it is ____________ .
Date operator++(int ) ► Member functions of post increment operator
► Member functions of pre increment operator
► Non-member functions of post increment operator
► Non-member functions of pre increment operator