New C++ New And Delete Interview Preparation Guide Download PDF
C++ New And Delete frequently Asked Questions by expert members with experience in C++ new and delete. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts
33 C++ New And Delete Questions and Answers:
Table of Contents:
1 :: Which of the following is a valid array declaration?
select one:
a. char[] c = new char[5];
b. char[] c = new char[];
c. char c = new char();
d. char[] c = new char(4);?
Be the First to Post Your Answer Now
4 :: You can use C++ as a procedural, as well as an object-oriented language?
a) true
b) false
a) true
6 :: Inventor of C++ language is
a) John Dell
b) Bjarne Stroustrup
c) Thomusn Steve
d) Karl Thomus
b) Bjarne Stroustrup
9 :: In the following statements,
class ABC;
class ABC
{
};
a) It is called as forward declaration
b) It is called as backward declaration
c) It is called as middle declaration
d) It is called as simple declaration
a) It is called as forward declaration
10 :: Object can be used as a function argument by..
a) Pass by value
b) Pass by reference
c) None of above
d) All of above
d) All of above
11 :: In C++, symbolic constants created using:
a) const
b) enum
c) Both of above
d) None of above
c) Both of above
12 :: A friend function that is a "friend" of a given class is allowed access to ______data in that class.
a) public, private, or protected
b) public or private
c) public
d) protected
a) public, private, or protected
13 :: A friend class in C++, can access the "__________" members of the class in which it is declared as a friend:
a) private and protected
b) private and public
c) public and protected
d) Public
a) private and protected
15 :: int const *ptr1 = &m;
// this is example of,
a) Constant pointer
b) Pointer to a constant
c) Both of above
d) None of above
b) Pointer to a constant
16 :: char * const ptr1 = "nice";
//this is example of ,
a) constant pointer
b) pointer to a constant
c) None of above
d) Both of above
a) constant pointer
17 :: C++ supports ….
a) constant pointer
b) pointer to a constant
c) None of above
d) Both of above
d) Both of above
18 :: Which of the following are valid array declaration?
a) char str1[3] = "ab"
b) char str1[3] = "abc"
c) char str1[2] = "ab"
d) char str1[0] = "ab"
a) char str1[3] = "ab"
19 :: Which of the following are valid array declaration?
a) int num(5)
b) float avg[5]
c) double[5] marks
d) counter int[5]
b) float avg[5]
22 :: Which of the following is invalid header file name?
a) <iostring>
b) <string>
c) <iostream >
d) <sstream>
a) <iostring>