Which of the Standard C++ casts can be used to perform a
?safe? downcast:
a) reinterpret_cast
b) dynamic_cast
c) static_cast
d) const_cast
Answers were Sorted based on User's Feedback
Answer / santosh mundhe
reinterpret_cast: Reinterpret_cast is only way to cast
between pointers and value type.
dynamic_cast:Dynamic_cast is used with pointers and
reference.It's purpose is - it provid valid object
conversion of requested class.
static_cast:Static_cast provides conversion from pointer to
related class not only from derived to base class.
const_cast:It manipulets constness of an object while
passing a const object to a function.
:-dynamic_cast performs a special checking during runtime.
| Is This Answer Correct ? | 3 Yes | 0 No |
How can you force instantiation of a template?
What is set in c++?
What do you mean by delegate? Can a user retain delegates?
What is a c++ map?
what is smart pointer & use of the smart pointer ???
Can we make copy constructor private in c++?
What are the general quetions are in DEna bank manager IT/System interviews?
What are the implicit member functions of class?
What is an incomplete type?
Which software is used for c++ programming?
Write a program to calculate the following i want a c++program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)
Is java the same as c++?