| 查看: 1853 | 回復(fù): 10 | ||
heroyejian銅蟲 (正式寫手)
|
[求助]
請解釋一下這句話的意思 static int (*usersMessage)(char*,...);
|
|
本人知道在在c語言中函數(shù)體外部使用static什么變量的話,是申明了一個文件級的外部變量,但是請問下面一句話如果定義在外部的話,是什么意思?我基礎(chǔ)很差 static int (*usersMessage)(char*,...); |
銅蟲 (正式寫手)
銅蟲 (正式寫手)
銅蟲 (正式寫手)
銅蟲 (正式寫手)
|
#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 */ }; |
銅蟲 (正式寫手)
|
你這個,已經(jīng)不是正常的UDF用法了。 而且,看起來似乎不是個完整的UDF,而只是一個框架,可以用來擴展功能的。 你看到的那個資料上沒有更詳細(xì)的說明么? |
銅蟲 (正式寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 生物學(xué)308分求調(diào)劑(一志愿華東師大) +5 | 相信必會光芒萬?/a> 2026-03-31 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 316求調(diào)劑 +11 | 舟自梗 2026-04-01 | 12/600 |
|
|
[考研] 070300化學(xué)求調(diào)劑 +14 | 小黃鴨寶 2026-03-30 | 14/700 |
|
|
[考研] 求調(diào)劑,一志愿 南京航空航天大學(xué) ,080500材料科學(xué)與工程學(xué)碩,總分289分 +11 | @taotao 2026-03-29 | 11/550 |
|
|
[考研] 調(diào)劑推薦 +10 | 清酒714 2026-03-26 | 12/600 |
|
|
[考研] 304求調(diào)劑 +12 | 素年祭語 2026-03-31 | 15/750 |
|
|
[考研] 273求調(diào)劑 +19 | 李芷新1 2026-03-31 | 19/950 |
|
|
[考研] 303分 0807學(xué)碩求調(diào)劑 +3 | TYC3632 2026-04-01 | 3/150 |
|
|
[考研] 283求調(diào)劑 +9 | A child 2026-03-28 | 9/450 |
|
|
[考研] 土木304求調(diào)劑 +3 | 兔突突突, 2026-03-31 | 3/150 |
|
|
[考研] 調(diào)劑申請 +8 | 張張張張zy 2026-03-31 | 9/450 |
|
|
[考研] 311(085601)求調(diào)劑 +12 | liziyeyeye 2026-03-28 | 13/650 |
|
|
[考研] 一志愿西交大080500材料學(xué)碩349 +6 | jqx1258 2026-03-31 | 7/350 |
|
|
[考研] 復(fù)試調(diào)劑 +7 | 雙馬尾痞老板2 2026-03-31 | 7/350 |
|
|
[考研] 一志愿a區(qū)211,085601-307分求調(diào)劑 +10 | 黨嘉豪 2026-03-31 | 23/1150 |
|
|
[考研] 0703 化學(xué) 求調(diào)劑,一志愿山東大學(xué) 342 分 +7 | Shern—- 2026-03-28 | 7/350 |
|
|
[考研] 303求調(diào)劑 +7 | DLkz1314. 2026-03-30 | 7/350 |
|
|
[考研] 一志愿雙一流機械285分求調(diào)劑 +4 | 幸運的三木 2026-03-29 | 5/250 |
|
|
[考研] 085602 化工專碩 338分 求調(diào)劑 +12 | 路癡小琪 2026-03-27 | 12/600 |
|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +8 | 邱gl 2026-03-27 | 8/400 |
|