| 查看: 1700 | 回复: 10 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
heroyejian铜虫 (正式写手)
|
[求助]
请解释一下这句话的意思 static int (*usersMessage)(char*,...);
|
|
|
本人知道在在c语言中函数体外部使用static什么变量的话,是申明了一个文件级的外部变量,但是请问下面一句话如果定义在外部的话,是什么意思啊?我基础很差 static int (*usersMessage)(char*,...); |
» 猜你喜欢
导师想让我从独立一作变成了共一第一
已经有8人回复
博士读完未来一定会好吗
已经有23人回复
到新单位后,换了新的研究方向,没有团队,持续积累2区以上论文,能申请到面上吗
已经有11人回复
读博
已经有4人回复
JMPT 期刊投稿流程
已经有4人回复
心脉受损
已经有5人回复
Springer期刊投稿求助
已经有4人回复
小论文投稿
已经有3人回复
申请2026年博士
已经有6人回复
» 本主题相关价值贴推荐,对您同样有帮助:
让你在办公室人气飙升的地道口语(转自 普特英语)
已经有1人回复
【转】女神的QQ动了,我大喜,点开后默泪了-----仅以此文祭典我死去的爱情
已经有49人回复
heroyejian
铜虫 (正式写手)
- 应助: 4 (幼儿园)
- 金币: 42
- 红花: 1
- 帖子: 455
- 在线: 53.2小时
- 虫号: 584367
- 注册: 2008-08-01
- 性别: GG
- 专业: 计算机软件
5楼2012-03-11 13:08:01
heroyejian
铜虫 (正式写手)
- 应助: 4 (幼儿园)
- 金币: 42
- 红花: 1
- 帖子: 455
- 在线: 53.2小时
- 虫号: 584367
- 注册: 2008-08-01
- 性别: GG
- 专业: 计算机软件
2楼2012-03-07 11:53:17
4楼2012-03-08 18:36:30
heroyejian
铜虫 (正式写手)
- 应助: 4 (幼儿园)
- 金币: 42
- 红花: 1
- 帖子: 455
- 在线: 53.2小时
- 虫号: 584367
- 注册: 2008-08-01
- 性别: GG
- 专业: 计算机软件
|
#include "udf.h" #include "stdio.h" #include "ctype.h" #include "stdarg.h" #define MW 28.996 /*空气的分子量*/ #define RGAS(UNIVERSAL_GAS_CONSTANT/MW) #define TDatum 288.15 /*参考温度*/ #define PDatum 1.01325e5 /*参考压强*/ static int (*usersMessage)(char*,...); //!!!!!!!!! static void (*usersError)(char*,...); //!!!!!!!!!有人能帮我解释一下这两句话的意思吗? DEFINE_ON_DEMAND(I_DO_NOTHING) { /*This is a dummy function to allow us to use*/ /*the Compiled UDFs utility*/ } void IDEAL_error(int err,char *f,char *msg) { if(err) usersError(''IDEAL_error(%d)from function:%s\n%s\n'',err,f,msg); } void IDEAL_Setup(Domain *domain, char*mygas,int(*messagefunc)(char*format),void(*errorfunc)(char*format)) { /*Use this function for any initialization or model setups*/ usersMessage=messagefunc; usersError=errorfunc; usersMessage(''\nLoading Real-Ideal Laibrary:%s\n'',mygas); } double IDEAL_density(double Temp, double press, double yi[]) { double r=press/(RGAS*Temp); /*Density at Temp and press*/ return r; /*(Kg/m^3)*/ } double IDEAL_specific_heat(double Temp, double press, double yi[]) { double cp=1006.43; return cp; } double IDEAL_mw(double yi[]) { return MW; /*(Kg/Kmol)*/ } double IDEAL_viscosity(double Temp, double density, double yi[]) { double mu=1.7894e-5; return mu; /*(Kg/m/s)*/ } double IDEAL_thermal_conductivity(double Temp, double density, double yi[]) { double ktc=0.0242; return ktc; /*(W/m/K)*/ } UDF_EXPORT RGAS_Functions RealGasFunctionList= { IDEAL_Setup, /*initialize */ IDEAL_density, /*density */ IDEAL_specific_heat, /*specific_heat */ IDEAL_mw, /*molecular_weight */ IDEAL_viscosity, /*viscosity */ IDEAL_thermal_conductivity, /*thermal conductivity */ }; |
6楼2012-03-11 13:14:25













回复此楼
送鲜花一朵
