About 1,900,000 results
Open links in new tab
  1. Need some clarification regarding casting in C - Stack Overflow

    Dec 22, 2009 · There are several situations that require perfectly valid casting in C. Beware of sweeping assertions like "casting is always bad design", since they are obviously and patently bogus. One …

  2. Python: typing.cast vs built in casting - Stack Overflow

    Jan 4, 2023 · 23 str(x) returns a new str object, independent of the original int. It's only an example of "casting" in a very loose sense (and one I don't think is useful, at least in the context of Python code). …

  3. casting - C convert floating point to int - Stack Overflow

    Jul 13, 2014 · I don't understand what you mean by “convert an int to a binary number”— int already is binary… Or do you mean to convert it to a string of the binary representation, e.g. convert 14 to …

  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. c# - Direct casting vs 'as' operator? - Stack Overflow

    Sep 25, 2008 · Direct Casting Types don't have to be strictly related. It comes in all types of flavors. Custom implicit/explicit casting: Usually a new object is created. Value Type Implicit: Copy without …

  6. 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 at run-time, …

  7. 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 float and n is a …

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

    Feb 26, 2011 · 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 …

  9. casting - Converting a string to a date in DB2 - Stack Overflow

    Jan 9, 2015 · I am working with a DB2 database for the first time. I am trying to work with DB2 dates, but the data is stored as a string in the DB2 database. I want to convert this date-string into an actual ...

  10. casting a Java array - Stack Overflow

    Sep 6, 2014 · i'm looking to cast an int array to a double one. so, when i have int arr[] = {1, 2, 3}; i want to use arr, say pass it as a double[] param to a method. what's the best way of doing this? the