C++ Questions

Q:

How many parameters are present in mismatch method in non-sequence modifying
algorithm?

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

Explanation:

There are four parameters. They are first1, last1, first2, predicate.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 6319
Q:

How many ways of reusing are there in class hierarchy?

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

Explanation:

Class hierarchies promote reuse in two ways. They are code sharing and interface sharing.

Report Error

View Answer Report Error Discuss

Filed Under: C++

0 6227
Q:

The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is

A) int **fun(float**, char**) B) int *fun(float*, char*)
C) int ***fun(float*, char**) D) int ***fun(*float, **char)
 
Answer & Explanation Answer: C) int ***fun(float*, char**)

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

3 6045
Q:

What will happen when introduce the interface of classes in a run-time polymorphic hierarchy?

A) Separation of interface from implementation B) Merging of interface from implementation
C) Separation of interface from debugging D) None of the mentioned
 
Answer & Explanation Answer: A) Separation of interface from implementation

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 5895
Q:

What is the user-defined header file extension in c++?

A) cpp B) h
C) hf D) none of these
 
Answer & Explanation Answer: B) h

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 5835
Q:

What is the data structures used to perform recursion?

Answer

Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

3 5771
Q:

What of the following describes protected access specifier?

A) The variable is visible only outside inside the block B) The variable is visible everywhere
C) The variable is visible to its block and to it’s derived class D) None of these
 
Answer & Explanation Answer: C) The variable is visible to its block and to it’s derived class

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

2 5647
Q:

What do vectors represent?

A) Static arrays B) Dynamic arrays
C) Stack D) Queue
 
Answer & Explanation Answer: B) Dynamic arrays

Explanation:

Vectors are sequence containers representing arrays that can change in size.

Report Error

View Answer Report Error Discuss

Filed Under: C++

0 5269