CS201 Quiz Introduction to Programming C++ [9]
Question # 1
There is a class Student, Which one of the following is a valid destructor for this class. 1) : Student();
2) : Student(int);
3) : ~ Student();
4) : ~ Student(int);
Question # 2
The function call to a default constructor 1) : looks like any function call, except there is no return value
2) : is made automatically when an object is created
3) : creates but cannot initialize an object
4) : never takes any arguments
Question # 3
The new operator 1) : can allocate an appropriate amount of memory for an object or variable
2) : can not create and initialize an object
3) : is used to declare objects or variables
4) : returns a pointer to an object or variable
Question # 4
The new operator 1) : is used to declare objects or variables
2) : can not create and initialize an object
3) : names an object or variable
4) : can allocate an appropriate amount of memory for an object or variable
Question # 5
Which of the following operators can not be overloaded? 1) : new
2) : delete
3) : +=
4) : sizeof
Question # 6
this is a pointer which always points to the current object. 1) : TRUE
2) : FALSE
3) :
4) :
Question # 7
Which of the following is the correct C++ syntax to allocate space dynamically for an array of 10 int? 1) : new int(10) ;
2) : new int[10] ;
3) : int new(10) ;
4) : int new[10];
Question # 8
The function free() returns back the allocated memory got thorough calloc and malloc to _____ . 1) : stack
2) : heap
3) : stack and heap
4) : None of the given options
Question # 9
Whenever new operator is used, no number of bytes or sizeof operator is required. 1) : True
2) : FALSE
Question # 10
If the memory in the free store is not sufficient enough to fulfill the request, malloc() function returns NO pointer. 1) : True
2) : FALSE