Top "Type-conversion" questions

Type conversion is the way of implicitly or explicitly changing an entity of one data type into another.

What happens if I assign a negative value to an unsigned variable?

I was curious to know what would happen if I assign a negative value to an unsigned variable. The code …

c++ type-conversion integer unsigned signed
C - unsigned int to unsigned char array conversion

I have an unsigned int number (2 byte) and I want to convert it to unsigned char type. From my search, …

c byte unsigned-integer type-conversion unsigned-char
ARC and bridged cast

With ARC, I can no longer cast CGColorRef to id. I learned that I need to do a bridged cast. …

objective-c automatic-ref-counting type-conversion clang
Convert string to Enum in Python

I wonder what's the correct way of converting (deserializing) a string to a Python's Enum class. Seems like getattr(YourEnumType, …

python string serialization enums type-conversion
Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?

I was practicing some JavaScript when one of my friends came across this JavaScript code: The above code answers "banana"! …

javascript type-conversion
SQL ORDER chars numerically

I have a column of numbers stored as chars. When I do a ORDER BY for this column I get …

sql char type-conversion sql-order-by numerical
Convert long to byte array and add it to another array

I want to change a values in byte array to put a long timestamp value in in the MSBs. Can …

java bytearray type-conversion long-integer
How do I convert from an integer to a string?

I am unable to compile code that converts a type from an integer to a string. I'm running an example …

string int type-conversion rust
How can I convert decimal? to decimal

may be it is a simple question but I'm try all of conversion method! and it still has error! would …

c# .net decimal type-conversion nullable
Cast syntax to convert a sum to float

Using PostgreSQL 9.3, I want to convert the calculated values to data type float. My first attempt: SELECT float(SUM(Seconds))/…

sql postgresql casting type-conversion postgresql-9.3