Take the 2-minute tour ×  I know char *x means a pointer to
char, but I'm confused about what (char*) x means.
share|improve this question add comment  7 Answers  It's a cast.
You are instructing the compiler to treat x as if it were a char
*, regardless of its real type. Casts should only be used if you
really know what you are doing.  For some built-in types, the
compiler may perform a meaningful conversion, e.g. converting a
double to an int by rounding, but for other types you may not
get what you expect.  share|improve this answer It's not just
treating. the value of (char*)x may be different from the value
of x (even if x is pointer) –  asaelr Jan 30 '12 at 21:49
Casting pointers doesn't modify the value. So it doesn't convert
anything. Please verify your answer and change it accordingly,
you're giving wrong information here. –  Luchian Grigore Jan 30
'12 at 21:55 If I'm not mistaken, nothing in the standard
promise that. –  asaelr Jan 30 '12 at 22:02 @Luchian I said for
SOME built-in types, the compil