Agilent Interview questions
1]. What are the default member functions included in the class definition ?
2]. Does default destructor provided by the compiler?
3]. How to make a class to restrict its number of instances to 5?
4]. What is singleton class? Design it.
5]. What will happen?
/* Some other code */
8]. What are the various storage classes ?
A. Extern, Static, Auto, Register
9]. Is this right ? Why or Why not?
static extern int x;
Ans: No, It will give compilation error. "more than one storage class specified", Reason is obvious.
10]. What is the need of writing our own copy constructor when it is by default provided by the compiler?
11]. What is object slicing?
12]. What is stack unwinding?
13]. Can we use references as class member variables?
Ans: Yes, we can. But then it must be initialized in constructor base/member initializer list. e.g.
cout<<"A x="<<<" y="<<