mallocって
char *str;

/* 文字列のためのメモリを確保 */
str = (char *)malloc(100);

こんな感じに書いてるけど

char str[100]

ってやった方が楽じゃん。なんでmallocなんて使うの?