troubleshooting Question

Questions about C++

Avatar of saygapro
saygapro asked on
C++
4 Comments1 Solution201 ViewsLast Modified:
I found some questions in a C++ book and there is no provided solutions to these questions. These questions sort of confuse me and I wondering if someone help me answer these questions. This is not an assignment but for learning purposes.

1) C++ adds ______ new cast operators in addition to C's casting operator.
    (a) 0 (b) 1 (c) 2 (d) 3 (e) 4 (f) 5

I believe this is 4. The static cast, dynamic cast, reinterpret cast and the const cast.

------------------------------------------------------------------------------------------------------------------
Q2) To behave like Java and other object-oriented languages, one needs to make all inheritance
________.
(a) public (b) protected (c) private (d) virtual (e) non-virtual

Public?

-------------------------------------------------------------------------------------------------------------------
Q3) To behave like Java and other object-oriented languages, one needs to make non-static
member functions _____.
(a) public (b) protected (c) private (d) virtual (e) non-virtual

Can't a non-static member function be all of the above? If not why?

--------------------------------------------------------------------------------------------------------

Q4) To catch any exception, one needs to fill in this catch(________) clause with:
(a) std::throwable& (b) std::exception& (c) ... (e) none of these

none of these
----------------------------------------------------------------------------------------------------------

Q5) To rethrow an exception that has just been caught, one would write this statement in the
catch clause's body:
Answer: __________________________

throw;
----------------------------------------------------------------------------------------------------------
Q6) The iostream's can be extended to support new stream devices by writing a class that
inherits from the class:
Answer: __________________________

Not sure.

--------------------------------------------------------------------------------------------------------------
Q7) The this pointer is a ____________ pointer to an object.
Answer: __________________________

I am not sure what they are looking for here. A special type of pointer?

Thanks.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros