SET 3 QUESTIONS FOR TECHNICAL INTERVIEW ON C++
1. Suppose many functions have the same name, which of the following information , if there , will be used by the compiler to invoke the correct function to be used ?
(a) The operator :: (b) The return value of the function
(c) Function signature (d) None of the above
2. A constructor is called whenever
(a) a class is used (b) an object is used
(c) all of these (d) an object is declared
3. Which of the following are correct for constructors and destructors ?
(a) Constructors can take arguments but destructors cannot.
(b) Constructors can be overloaded but destructors cannot.
(c) All of these
(d) Destructors can take arguments but constructors cannot.
4. The declaration
int x ; int &p=x ;
is same as the declaration
int x , *p; p=&x;
This remark is
(a) false (b) true
(c) none of these (d) sometimes true`
5. The following program segment
int a= 10;
int const &b = a;
a=11;
cout<<a<<b;
(a) Results in compile time error (b) results in run time error
(c) prints 1111 (d) none of the these
CLICK HERE TO SEE THE ANSWER
ANSWER IS (c)
No comments:
Post a Comment