17. The following line appears in the header file of class Node:
friend class Queue;
What does it give ?
a. an instance of Queue the ability to construct a Node object
b. an instance of Node the ability to construct a Queue object
c. Queue member functions unrestricted access to private members of Node
d. Node member functions unrestricted access to private members of Queue
18. Consider the following program
#include <iostream.h>
int main(void)
{
int p[2] = {2,4};
(*p)++ ;
cout << "Output : " << p[0] << endl;
return 0;
}
What will be the output?
a. output = 2
b. output = 3
c. output = 4
d. The program won't compile due to syntax error
19. Consider the following program
int symmetricTrans(int x, const char c);
float symmetricTrans(const char x, float f) ;
Which of the following correctly declares and initialises function pointers the overloaded function:
a.
void *fp1 = symmetricTrans(int, const, char);
void *fp2 = symmetricTrans(const char, float) ;
b.
void *fp1 = &symmetricTrans ;
void *fp2 = &symmetricTrans ;
c.
int (*fp1)(int, const char) = &symmetricTrans ;
float (*fp2)(const char, float) = &symmetricTrans ;
d.
int (*fp1) = &symmetricTrans(int, const char) ;
float (*fp2) = &symmetricTrans(const char, float) ;
20. Can you name the special functions a C++ compiler creates implicitly on a class?
a. the default constructor and default destructor
b. the default constructor, copy constructor and assignment operator
c. the default constructor, copy constructor and destructor
d. all of the above