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

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

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

  4. 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?

  5. c++ - Proper way of casting pointer types - Stack Overflow

    Proper way of casting pointer types Asked 12 years, 8 months ago Modified 1 year ago Viewed 128k times

  6. Safe casting in python - Stack Overflow

    Casting has sense only for a variable (= chunk of memory whose content can change) There are no variables whose content can change, in Python. There are only objects, that aren't contained in …

  7. Casting a number to a string in TypeScript - Stack Overflow

    465 "Casting" is different than conversion. In this case, window.location.hash will auto-convert a number to a string. But to avoid a TypeScript compile error, you can do the string conversion yourself:

  8. 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, typeof(int)) will return 6.

  9. Casting to string versus calling ToString - Stack Overflow

    Oct 14, 2009 · Casting to string versus calling ToString Asked 16 years, 1 month ago Modified 5 years, 2 months ago Viewed 49k times

  10. sql - datetime Cast or Convert? - Stack Overflow

    Jul 2, 2013 · 10 convert has an optional parameter style, and I suggest to use convert instead of cast. It helps to avoid confusion. For example, if you write cast('20130302' as date), what would you get? …