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...

Which of the Standard C++ casts can be used to perform a
?safe? downcast:
a) reinterpret_cast
b) dynamic_cast
c) static_cast
d) const_cast

Answer Posted / santosh mundhe

reinterpret_cast: Reinterpret_cast is only way to cast
between pointers and value type.

dynamic_cast:Dynamic_cast is used with pointers and
reference.It's purpose is - it provid valid object
conversion of requested class.

static_cast:Static_cast provides conversion from pointer to
related class not only from derived to base class.

const_cast:It manipulets constness of an object while
passing a const object to a function.

:-dynamic_cast performs a special checking during runtime.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best c++ compiler for windows 10?

1041


What are libraries in c++?

1071


What is encapsulation in c++?

1298


What do you mean by early binding?

1069


Explain all the C++ concepts using examples.

1206


What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)

1056


What is vectorial capacity?

1166


Why do we use the using declaration?

1175


Is c++ a float?

1067


Why do we use pointers in c++?

1061


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

1163


Is c or c++ more useful?

1054


On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?

1135


What is prototype for that c string function?

1140


What is a driver program?

1107