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
What is the difference between strcpy() and strncpy()?
Which is best ide for c++?
Write a program to find the reverse Fibonacci series starting from N.
What are disadvantages of pointers?
What is the v-ptr?
What do you mean by vtable and vptr in c++?
What is the limitation of cin while taking input for character array?
What is rtti in c++?
What is near, far and huge pointers? How many bytes are occupied by them?
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Why namespace is used in c++?
What language does google use?
Why iomanip is used in c++?
Does c++ have finally?
What is extern c++?