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
Is c++ pass by reference or value?
Do you know what are pure virtual functions?
Will the following program execute?
Is java made in c++?
What is const pointer and const reference?
How do I download c++?
What is data type in c++?
What is c++ good for?
What is a v-table?
What is meant by const_cast?
Why do we use setw in c++?
Write a program to find the reverse Fibonacci series starting from N.
Differentiate between a pointer and a reference with respect to c++.
Why c++ is faster than java?
Why do we need c++?