Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is this pointer in c++?

1324


What happens when you make call 'delete this;'?

1037


Write some differences between an external iterator and an internal iterator?

975


Why do we learn c++?

913


What are friend functions in C++?

1017


Can you use the function fprintf() to display the output on the screen?

1200


What is the difference between #import and #include in c++?

1067


What is the use of object in c++?

1061


What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard

983


Mention the ways in which parameterized can be invoked. Give an example of each.

1011


What do you mean by storage classes?

1515


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

1041


Explain pass by value and pass by reference.

1015


What is virtual destructor ans explain its use?

1084


Is java the same as c++?

945