I know char *x
means a pointer to char, but I\'m confused about what (char*) x
means.
Actually, char *x
is a declaration. x
is pointer to char.
If you already have a variable, such as x
, you can cast it to a different type. In your case, (char*) x
is redundant, since x
already is a pointer to char. But you can cast it to int *
or something else. Although, note, it's not safe, since an int is larger than a char.