(A) int[8]
(B) int[7]
(C) myArray[7]
(D) myArray[8]
Tag: Intro to Programming
A copy constructor?
(A) creates an object initialized with the same data as an existing object
(B) creates a new object that later may be assigned the data of an existing object
(C) creates a new object that later may be assigned the data of an existing object
(D) takes an arbitrary number of arguments
There is a class Student, Which one of the following is a valid destructor for this class?
(A) Student();
(B) Student(int);
(C) ~ Student();
(D) ~ Student(int);
If we open a file stream myfile for reading, what will give us the current position of the file pointer?
(A) tellg()
(B) tellp()
(C) seekg()
(D) seekp()
The new operator?
(A) is used to declare objects or variables
(B) can not create and initialize an object
(C) can allocate an appropriate amount of memory for an object or variable
(D) returns an address to an object or variable
A friend function of a class has access?
(A) To all data member and functions of the class
(B) Only to other friend functions of the class
(C) Only to private data of the class
(D) Only to public data of the class
When we write a class template the first line must be:
(A) template < class class_type>
(B) template < class data_type>
(C) template < class T >, Here T can be replaced with any name but it is preferable.
(D) class class-name()
A function declaration has the same relationship to a function definition that?
(A) a class definition has to an object definition
(B) an object declaration has to an object
(C) a variable has to a variable declaration
(D) a variable declaration has to the variable itself