About 2,120,000 results
Open links in new tab
  1. 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 …

  2. Best practice in C++ for casting between number types

    May 28, 2016 · What is the best practice for casting between the different number types? Types float, double, int are the ones I use the most in C++. An example of the options where f is a …

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

  4. 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<> (), …

  5. casting - How to cast or convert an unsigned int to int in C?

    The real question is what you want to do when/if the value in the unsigned int it out of the range that can be represented by a signed int. If it's in range, just assign it and you're done. If it's out …

  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. c# - 'casting' with reflection - Stack Overflow

    Sep 9, 2009 · I know this question is old, but also notice that Convert.ChangeType can return a different value than plain casting. For example, double d = 5.57293; int i = Convert(d, …

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

  9. Casting in Zig (like usize to i32 and more) - Stack Overflow

    Dec 6, 2023 · Casting in Zig (like usize to i32 and more) Asked 1 year, 11 months ago Modified 1 year, 11 months ago Viewed 12k times

  10. type casting int to double java? - Stack Overflow

    A variable's type is not only a view (or similar) to the value that you can later widen with some sort of cast. It represents the memory space and its value representation inside that space. The …