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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a friend function in c++?

583


What is binary object model?

605


What is the oldest programming language?

571


What is #include iostream h in c++?

618


Is atoi safe?

603






Explain the properties and principles of oop.

533


what are the events occur in intr activated on interrupt vector table

1183


How to access a variable of the structure?

585


What are friend classes? What are advantages of using friend classes?

612


Write about the various sections of the executable image?

577


what are function pointers?

582


What do the keywords volatile and mean mutable?

610


Write about the stack unwinding?

630


Explain the extern storage classes in c++.

556


Define basic type of variable used for a different condition in C++?

670