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 meant by forward referencing and when should it be used?
Explain "const" reference arguments in function?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
If a function doesn’t return a value, how do you declare the function?
What is a down cast?
Explain how to initialize a const member data.
What is rvalue?
Why was c++ made?
Explain dangling pointer.
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
Which software is used to run c++ program?
What is c++ stringstream?
What is vector processing?
What are the advantages of early binding?
Why is c++ considered difficult?