[*(char*)p1]
is somewhat incomplete, there needs to be a variable name in front of it for the array subscription to make sense, such as for example foo[*(char*)p1]
.
In that case, it means:
- convert p1 to pointer-to-char
- dereference this pointer (giving a
char
value)
- use this value as index to look up in an array
Note that using a char
as index will make most compilers unhappy and cause it to emit a warning. That is because most often when a char
is used as an index, it happens by error, not by intent, and also because it is implementation-defined whether char
is signed or unsigned (so it is inherently non-portable, and you may end up indexing out of bounds by accident, if you assume the wrong one).