Assuming that the address 0xCF800000 is free for writing:
A) Is it correct to say that both codes produce the same result?
int main( void )
{
volatile unsigned long *pt = (volatile unsigned long *) 0xCF800000;
*pt = 0x00000000;
}
and
int main( void )
{
(*(volatile unsigned long *) 0xCF800000) = 0x00000000;
}
B) On the first code, the statement " (volatile unsigned long *) " before 0xCF800000 is necessary or is a redundancy?
C) On the first code there is a variable pt, that has its own address, where I put some content: 0xCF800000. By dereferencing pt, the computer will take the contents of pt (0xCF800000), 'locate' that address, and assign 0x00000000 to that location. On the second code, I can not understand exactly how it works, since there is no variable. Looks like the information 0xCF800000 is "nowhere".