*(int*)a
should give you the contents of the location pointed to by a
, while treating a
as if it was a pointer to an integer. If a
was already a pointer to an integer, *(int*)a
is equivalent to *a
. The stuff in the brackets is a cast operator.
any
is now the equivalent of void *
, or a generic pointer that does not refer to any specific value type. void *
is normally used for places where you don't want to specify what a pointer is pointing to, but just identify a location in memory (with no regard to its contents). To get the value pointed to by a void pointer, you first need to cast it into a pointer to a specific type, which is what (struct a*)j
does: treats j
as if it was a pointer to struct a
.