While CPallini is of course correct, the reason for your confusion may have been the somewhat involved pointer modification in the expression
(*(volatile unsigned int *)(address))
In this expression:
-
unsigned int
is the base type used for a (C-style) type-cast
-
volatile
is a type modifier (such as
const
), telling the compiler that the
unsigned int
value accessed here may change at any time
-
(volatile unsigned int*)
is a type-cast to 'pointer to a
volatile
value of type
unsigned int
'
-
(address)
is the argument to the type-cast; the brackets may be necessary, if an expression is used as an address rather than a variable or literal
A function pointer
type definition
looks a bit similar due to the surrounding
'()'
, the obligatory
'*'
, and the function argument list. I've tried to figure out how this should look like if it were to be the assignment of a function pointer, i.e. if the type cast were meant to change the type of
address
to a function pointer, which gets assigned a new value:
(unsigned int (cdecl)())(address) = value
[edit]Checked with the compiler and fixed the type cast syntax; but the compiler doesn't accept it anyway since it won't let me assign a value to a function pointer [/edit]
Note the additional empty set of
()
after
(address)
. It gives away the fact we're dealing with a function pointer rather than an ordinary one. Also, I left out
volatile
, because that's an invalid qualifier for return types (or, in other words, the
volatile
in your expression is an indication this is not a function pointer)