|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
想用ADJUST宏求取某一个面上的温度平均值,实现这个平均值的实时更新,因为其他宏要用到。但是编译时会出错,程序及错误信息如下:
#include "udf.h"
#include "mem.h"
real avg=0.;
DEDINE_ADJUST(adjust_avg,d)
{
real sum=0.;
int n=0;
CX_Message("Computing the avg :\n");
Thread *t=Lookup_Thread(d,6);
cell_t c;
begin_c_loop(c,t)
{
sum+=C_T(c,t);
n++;
}
end_c_loop(c,t)
avg=sum/n;
}
..\..\src\try.c(13) : error C2275: 'Thread' : illegal use of this type as an expression
..\..\src\mem.h(653) : see declaration of 'Thread'
..\..\src\try.c(13) : error C2065: 't' : undeclared identifier
..\..\src\try.c(13) : warning C4047: 'function' : 'struct domain_struct *' differs in levels of indirection from 'int '
..\..\src\try.c(13) : warning C4024: 'Lookup_Thread' : different types for formal and actual parameter 1
..\..\src\try.c(14) : error C2275: 'cell_t' : illegal use of this type as an expression
..\..\src\mem.h(173) : see declaration of 'cell_t'
..\..\src\try.c(14) : error C2146: syntax error : missing ';' before identifier 'c'
..\..\src\try.c(14) : error C2065: 'c' : undeclared identifier
..\..\src\try.c(16) : error C2223: left of '->nelements' must point to struct/union
..\..\src\try.c(18) : error C2223: left of '->storage' must point to struct/union
尼玛错误信息都快比程序长了……求指教,到底咋回事?ADJUST宏里不能用Lookup_Thread吗?? |
|