About 50 results
Open links in new tab
  1. c# - Direct casting vs 'as' operator? - Stack Overflow

    Sep 25, 2008 · Custom implicit/explicit casting: Usually a new object is created. Value Type Implicit: Copy without losing information. Value Type Explicit: Copy and information might be lost. IS-A …

  2. Casting variables in Java - Stack Overflow

    Mar 13, 2011 · Casting in Java isn't magic, it's you telling the compiler that an Object of type A is actually of more specific type B, and thus gaining access to all the methods on B that you wouldn't have had …

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

  4. casting - How to cast a double to an int in Java by rounding it down ...

    Jan 26, 2010 · Actually, the floating point question is more accurately asking how to round a float (as per some unspecified rounding standard). This question, which could probably be renamed more …

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

  6. What exactly is a type cast in C/C++? - Stack Overflow

    Not only that, but it offers more restrictive explicit casts, such as static_cast, dynamic_cast, reinterpret_cast, and const_cast, each of which further restricts the explicit cast to only a subset of …

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

  8. What are the rules for casting pointers in C? - Stack Overflow

    Jun 23, 2013 · There are rules about casting pointers, a number of which are in clause 6.3.2.3 of the C 2011 standard. Among other things, pointers to objects may be cast to other pointers to objects and, …

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

  10. Difference between casting and using the Convert.To () method

    Mar 14, 2013 · Casting is the action of changing an entity of one data type into another. It's a little bit generic and it's somehow equivalent to a conversion because a cast often has the same syntax of a …