What does this cast do?

S

santosh

Message ID: said:
*((volatile unsigned char *) 0xe00e0f3c) = 0x00800000;

This statement attempts to cast the numeric value 0xe00e0f3c, (whose
type will be implementation dependant, since you did not specify a
type), into a volatile qualified unsigned char * value. This
conversion of an integer value to a pointer type is implementation
defined. On some systems, under some circumstances they make sense.

The expression then attempts to deference the address that results
from the above cast, and store the value 0x00800000 into it. Since
the pointer value is of type unsigned char *, the type pointed to is
unsigned char. The value of the RHS of the assignment operator is
implicitly converted into an unsigned char type, before assignment.
Whether some data is lost in this conversion is again implementation
dependant. Information may not be lost if on the implementation,
unsigned char is at least of 24 value bits.
 
H

Harald van =?UTF-8?B?RMSzaw==?=

robert said:
*((volatile unsigned char *) 0xe00e0f3c) = 0x00800000;

This does the same thing as it did when you asked about it yesterday.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top