*((char *)data);

Also, as soon as you understand what your program is doing, throw the program away, and quickly. As GCDEF pointed out, you should never use sizeof() to determine what to cast a...