0
Q:

What is the output of this program?

 #include
       using namespace std;
       int main()
       {
           int arr[] = {4, 5, 6, 7};
           int *p = (arr + 1);
           cout << arr;
           return 0;
       }

A) 4 B) 5
C) address of arr D) 7

Answer:   C) address of arr



Explanation:

As we couted to print only arr, it will print the address of the array.

Subject: C++
Q:

What is meant by exception specification?

A) A function is limited to throwing only a specified list of exceptions. B) A catch can catch all types of exceptions.
C) A function can throw any type of exceptions. D) none of the mentioned
 
Answer & Explanation Answer: A) A function is limited to throwing only a specified list of exceptions.

Explanation:

C++ provides a mechanism to ensure that a given function is limited to throwing only a specified list of exceptions. It is called as exception specification.

Report Error

View Answer Report Error Discuss

Filed Under: C++

0 3695
Q:

How to handle error in the destructor?

A) throwing B) terminate
C) both a & b D) none of the mentioned
 
Answer & Explanation Answer: B) terminate

Explanation:

It will not throw an exception from the destructor but it will the process by using terminate() function.

Report Error

View Answer Report Error Discuss

Filed Under: C++

3 6880
Q:

What are the operators available in dynamic memory allocation?

A) new B) delete
C) compare D) both a & b
 
Answer & Explanation Answer: D) both a & b

Explanation:

new and delete operators are mainly used to allocate and deallocate
during runtime.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 2662
Q:

Where does the exception are handled?

A) inside the program B) outside the regular code
C) both a & b D) none of these
 
Answer & Explanation Answer: B) outside the regular code

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3216
Q:

Where does the exceptions are used?

A) Exceptions are used when postconditions of a function cannot be satisfied. B) Exceptions are used when postconditions of a function can be satisfied.
C) To preserve the program D) none of these
 
Answer & Explanation Answer: B) Exceptions are used when postconditions of a function can be satisfied.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3604
Q:

How do define the user-defined exceptions?

A) inheriting and overriding exception class functionality. B) overriding class functioality.
C) inheriting class functionality D) none of the mentioned
 
Answer & Explanation Answer: A) inheriting and overriding exception class functionality.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

4 9324
Q:

How many kinds of entities are directly parameterized in c++?

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: C) 3

Explanation:

C++ allows us to parameterize directly three kinds of entities through templates: types, constants, and templates.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 4162
Q:

What is meant by template specialization?

A) It will have certain data types to be fixed. B) It will make certain data types to be dynamic.
C) Certain data types are invalid D) None of the mentioned
 
Answer & Explanation Answer: A) It will have certain data types to be fixed.

Explanation:

In the template specialization, it will make the template to be specific for some data types.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3703