正确写法: int *tmp = ( int * )malloc( H*W*sizeof(int) ); float *tmp = ( float * )malloc( H*W*sizeof(float) );