About 2,380,000 results
Open links in new tab
  1. java: How can I do dynamic casting of a variable from one type to ...

    2 Your problem is not the lack of "dynamic casting". Casting Integer to Double isn't possible at all. You seem to want to give Java an object of one type, a field of a possibly incompatible type, …

  2. Regular cast vs. static_cast vs. dynamic_cast - Stack Overflow

    Aug 26, 2008 · Static cast is also used to cast pointers to related types, for example casting void* to the appropriate type. dynamic_cast Dynamic cast is used to convert pointers and references …

  3. c++ - When should static_cast, dynamic_cast, const_cast, and ...

    The C-style casts can do virtually all types of casting from normally safe casts done by static_cast<> () and dynamic_cast<> () to potentially dangerous casts like const_cast<> (), …

  4. c# - Direct casting vs 'as' operator? - Stack Overflow

    Sep 25, 2008 · Direct casting vs 'as' operator? Asked 17 years, 1 month ago Modified 6 years, 5 months ago Viewed 238k times

  5. Type-casting in C++ - Stack Overflow

    Jan 30, 2015 · Casting one of the operands of / to double which will lead to the other getting implicitly converted to a double too, and thus the division (and its result) would now be floating …

  6. casting - How to cast int to enum in C++? - Stack Overflow

    May 28, 2017 · How do I cast an int to an enum in C++? For example: enum Test { A, B }; int a = 1; How do I convert a to type Test::A?

  7. casting - Converting double to integer in Java - Stack Overflow

    Jun 24, 2011 · is there a possibility that casting a double created via Math.round() will still result in a truncated down number No, round() will always round your double to the correct value, and …

  8. Casting variables in Java - Stack Overflow

    Mar 13, 2011 · Regarding use for casting, you still see the need for it in some libraries. Pre Java-5 it was used heavily in collections and various other classes, since all collections worked on …

  9. casting - Explanation of ClassCastException in Java - Stack Overflow

    May 25, 2009 · 6 Do you understand the concept of casting? Casting is the process of type conversion, which is in Java very common because its a statically typed language. Some …

  10. casting - How do I convert between numeric types safely and ...

    Feb 2, 2015 · For example, casting using 4294967295us as u32 works and the Rust 0.12 reference docs on type casting say A numeric value can be cast to any numeric type. A raw …