Programming C++ (Virtual Function)

Hello Guys, I just want to make sure of my answers
What do you think of these questions?

True or False
1) A regular virtual function declared in a base class must be implemented in the same base class.

2) In a base class, pure virtual function may be implemented in that class

3) A function declared as follows:
void func(parameter_list);
must no throw any exception

4) A function declared as follows:
void func(parameter_list) throw();
must not throw any exception

5) If an exception is thrown inside a function, say f(), but no handled there, the exception is propagated to the function that called f().
You didn't write your answers.

4.) False, but you should decide: the behavior is perfectly well-defined if it does throw, but std::unexpected will be called: i.e., it is legal to throw from that function, although an empty exception specification is a promise you would not.
Last edited on
1_ F
2_F
3_T
4_T
5_F

That's my answers
Topic archived. No new replies allowed.