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


different types of castings

Answers were Sorted based on User's Feedback



different types of castings..

Answer / mms zubeir

The above answers are correct. I would like to add some
details to those.

1. const_cast:- is used to cast away the constness of a
variable.

2. static_cast:- is used to cast between two types with the
available static information about the variable. It doesn't
know anything about the run time information. Additionally,
it knows the type and access previledges of the
variables/objects involved in the casting. For example, we
cannot cast a private base.

3. reinterpret_cast:- is used to cast between any pointer
types and the types need not be related. The developer
needs to take care of the correct types to be casted.

4. dynamic_cast:- is used to cast between polymorphic types
only. It allows downcasting and casting between siblings as
well. If the cast fails, it returns a 0/NULL instead of the
pointer to the resultant object incase of success.

Is This Answer Correct ?    6 Yes 4 No

different types of castings..

Answer / sanjay makwana

Const Cast,
Static cast,
reinterprit cast,
dynamic cast

Is This Answer Correct ?    8 Yes 7 No

different types of castings..

Answer / vinayaka kc

2 types of casting
1] Implicit casting
2] Explicit casting
(a)Const Cast,
(b)Static cast,
(c)reinterprit cast,
(d)dynamic cast;

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More OOPS Interview Questions

what is namespace? what are the uses of namespace?

1 Answers  


What are the access specifiers avaible in c++?

4 Answers  


what is overloading and overriding?

7 Answers  


what uses of c++ language?

3 Answers  


1. Define a class.

6 Answers  


what is runtime polymorphism? For the 5 marks.

3 Answers  


where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


What is the different between Applet and Application?

2 Answers  


1. Strong name 2. how to prevent a class from being inherited 3. delegates 4. default modifier for interface 5. default modifier for class 6. base class for exception 7. diff bet trigger and view in sql 8. how to exchange values from one page to another page 9. can multiple catch block ll be executed at same time 10. can u store different data types in an array & array list 11. when we ll use trigger 12. try,catch,finally usage

2 Answers  


What is the difference between pass by reference and pass by value?

12 Answers   Pfizer, TCS,


what is different between oops and c++

0 Answers   IIT,


What are the advantages of polymorphism?

0 Answers  


Categories