【发布时间】:2013-07-02 09:33:39
【问题描述】:
知道为什么会发生这种情况吗?
float *image;
long size_img=par->N*par->M;
image = calloc(size_img, sizeof(float));//the compiler shows error here
错误是
error: a value of type "void *" cannot be assigned to an entity of type "float *"
我应该做演员吗?虚假的事情是我在程序的其他地方做了同样的事情并且没有显示错误。
我把它作为我命名为 par 的结构的一部分
long *tbegin;
然后我做
par->tbegin = calloc( SUMA_J, sizeof ( long ) );
我没有收到任何错误。
【问题讨论】: