c++ - Conversion from unsigned to signed type safety? -


Is it safe to say a unsigned char * to sign a is? Four * * (or just a four * ?

Access is well defined, you are allowed to use an object through an indicator for a signed or unsigned type corresponding to the dynamic type (3.10 / 15) of the object.

Additionally, The signed letter is guaranteed to not have any trap value and as such you can use the signed four pointer You can safely read the value of the original unsigned char

You can certainly expect that the value you read through one pointer is through the other.

EDIT: Regarding the comments of SalesBitz, this is what is called 3.9.1 / 1.

A four, A signed four, and an unsigned four storage Mr. took amount capture and participate in the same alignment requirements (3. 9); that is, representing them all bits of the value of the character types that object representation, object representation. For unsigned character types, values ​​represent all possible bit pattern numbers of representation.

It seems that there can be net worth in signed four good catch!


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -