malloc() declaration

I'm trying to learn the lower level techniques, and I'm having trouble with malloc() on this particular type. That is, this code works fine...

char (*chChr)[MINNUM] = new char[iNum][MINNUM];

but I can't get it to work with malloc(). For example, this is just one of the combinations I can't get to compile...

char (*chChr)[MINNUM] = (char*)malloc( iNum * MINNUM );

How can I properly use malloc() to declare this?
char (*chChr)[MINNUM] = ( char (*)[MINNUM] ) malloc( iNum * MINNUM );
Thanks, that works well.
Topic archived. No new replies allowed.