On 01/03/2010 11:25 PM, Richard Guenther wrote:
>    char charray[sizeof(long)] = {...};
>    long l = *(long*)charray;  // ok

not correct;)   (the lvalue has to be of character type, yours is of
type 'long' - the type of the actual object does not matter)

What would be correct instead is

   memcpy ((char *) &l, charray, sizeof(long));

Paolo

Reply via email to