>>594
レスありがとうございます。勉強になります。
ところでこのやり方は関数中ではできないのでしょうか?

 int   width, hight;
 char *data;
 <scanfでhight, widthを入力>
 data[width] = (char)malloc(sizeof(char) * hight*width );

とすると'data' used before setとエラーが出てしまいます。