How many types of casting are there in C++?
When is a dynamic cast,static_cast,reinterpret cast used?
Answer Posted / berzerk
Casting Operators
There are several casting operators specific to the C++ language. These operators are intended to remove some of the ambiguity and danger inherent in old style C language casts. These operators are:
dynamic_cast Used for conversion of polymorphic types.
static_cast Used for conversion of nonpolymorphic types.
const_cast Used to remove the const, volatile, and __unaligned attributes.
reinterpret_cast Used for simple reinterpretation of bits.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Difference between delete and free.
what are the iterator and generic algorithms.
How does com provide language transparency?
Define a pdb file.
What data encapsulation is in c++?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
What do you mean by inheritance in c++? Explain its types.
What are the implicit member functions of class?
What are the uses of pointers?
Is oops and c++ same?
What are the three forms of cin.get() and what are their differences?
What are the characteristics of friend functions?
What is a buffer c++?
What is using namespace std in c++?
What is heap sort in c++?