About 50 results
Open links in new tab
  1. c# - Casting a variable using a Type variable - Stack Overflow

    In C# can I cast a variable of type object to a variable of type T where T is defined in a Type variable?

  2. 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 then, it …

  3. Casting to void* and Back to Original_Data_Type*

    Jul 29, 2025 · Casting to void* removes all type safety. If you use reinterpret_cast or static_cast to cast from a pointer type to void* and back to the same pointer type, you are actually guaranteed by the …

  4. Casting objects in Java - Stack Overflow

    Mar 15, 2011 · Casting can be used to clearly state that you are calling a child method and not a parent method. So in this case it's always a downcast or more correctly, a narrowing conversion.

  5. Casting interfaces for deserialization in JSON.NET

    Learn how to cast interfaces for deserialization in JSON.NET with examples and solutions provided by the community on Stack Overflow.

  6. Casting int to bool in C/C++ - Stack Overflow

    Jul 22, 2015 · I'm wondering about casting in the reverse direction... In the code below, all of the following assertions held true for me in .c files compiled with Visual Studio 2013 and Keil µVision 5. …

  7. 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<> (), where const modifier can …

  8. System.Text.Json: Deserialize JSON with automatic casting

    Nov 29, 2019 · Using .Net Core 3's new System.Text.Json JsonSerializer, how do you automatically cast types (e.g. int to string and string to int)? For example, this throws an exception because id in …

  9. Should I cast the result of malloc (in C)? - Stack Overflow

    Although malloc without casting is preferred method and most experienced programmers choose it, you should use whichever you like having aware of the issues. i.e: If you need to compile C program as …

  10. c++ - What does casting to `void` really do? - Stack Overflow

    Dec 15, 2015 · Casting a variable expression to void to suppress this warning has become an idiom in the C and later C++ community instead because the result cannot be used in any way (other than …