About 52 results
Open links in new tab
  1. How do I cast int to enum in C#? - Stack Overflow

    Casting is sometimes confusing in C# if you don't know the details... Anyhow, because int != short, it will throw (unboxing fails). If you do object o = (short)5;, it will work, because then the types will match. …

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

  3. ¿Cómo hago casting de manera correcta? (Java)

    Feb 9, 2020 · Por eso quería saber si hay alguna manera de hacerle casting. Aparte quería saber cuál es la parte que, a la hora de instar un objeto, es la que define qué tipo de objeto será.

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

  5. Why gdb casting is not working? - Stack Overflow

    Why gdb casting is not working? Asked 15 years ago Modified 6 years, 9 months ago Viewed 45k times

  6. c - Casting a function pointer to another type - Stack Overflow

    Casting between function pointers and regular pointers (e.g. casting a void (*)(void) to a void*). Function pointers aren't necessarily the same size as regular pointers, since on some architectures they might …

  7. Casting a large number type to a smaller type - Stack Overflow

    Jul 19, 2011 · Is it guaranteed that if I cast a 16 bit type to an 8 bit type that the leading byte will be lost? Depends on whether you are working with signed or unsigned types (see section 4.7 §2 and §3): If …

  8. c++ - Casting uint64 to uint32 and truncation - Stack Overflow

    Apr 29, 2023 · When we cast an uint64_t to an uint32_t, I see by reading cppreference that truncation happens. But, what bits are truncated? The higher or lower bits? How is this decided, and why?

  9. Using integer enum without casting in C# - Stack Overflow

    Nov 22, 2010 · Using integer enum without casting in C# Asked 15 years, 1 month ago Modified 2 years, 4 months ago Viewed 27k times

  10. TypeScript enum conversion / casting - Stack Overflow

    Mar 8, 2018 · The bottom line is you have to cast to some intermediate compatible type (number, string, any, unknown) before casting to 2nd enum, and by so doing, you have detached any meaningful …