| 查看: 1854 | 回復(fù): 10 | ||
heroyejian銅蟲 (正式寫手)
|
[求助]
請解釋一下這句話的意思 static int (*usersMessage)(char*,...);
|
|
本人知道在在c語言中函數(shù)體外部使用static什么變量的話,是申明了一個文件級的外部變量,但是請問下面一句話如果定義在外部的話,是什么意思。课一A(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é)碩化學(xué)工程與技術(shù),一志愿中國海洋大學(xué)320+求調(diào)劑 +3 | 披星河 2026-04-02 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 一志愿北京科技大學(xué)085601材料工程英一數(shù)二初試總分335求調(diào)劑 +9 | 雙馬尾痞老板2 2026-04-01 | 9/450 |
|
|
[考研] 0710生物學(xué)336分求調(diào)劑 +3 | kiyy 2026-04-01 | 3/150 |
|
|
[考研] 266分,一志愿電氣工程,本科材料,求材料專業(yè)調(diào)劑 +3 | 哇呼哼呼哼 2026-04-02 | 3/150 |
|
|
[考研] 289求調(diào)劑 +23 | 新時代材料 2026-03-27 | 26/1300 |
|
|
[考研] 07生物學(xué)求調(diào)劑 一志愿同濟大學(xué)359分 +3 | LAMC. 2026-03-30 | 3/150 |
|
|
[考研] 301求調(diào)劑 +13 | A_JiXing 2026-04-01 | 13/650 |
|
|
[考研] 一志愿南昌大學(xué)324求調(diào)劑 +12 | hanamiko 2026-03-27 | 12/600 |
|
|
[考研] 286求調(diào)劑 +16 | PolarBear11 2026-03-26 | 16/800 |
|
|
[考研] 283求調(diào)劑 +9 | A child 2026-03-28 | 9/450 |
|
|
[考研] 085410人工智能 初試316分 求調(diào)劑 +3 | 殘星拂曙 2026-03-31 | 3/150 |
|
|
[考研] 291求調(diào)劑 +3 | 迷蒙木木 2026-04-01 | 4/200 |
|
|
[考研] 358求調(diào)劑 +3 | 王向陽花 2026-03-31 | 3/150 |
|
|
[考研] 311(085601)求調(diào)劑 +12 | liziyeyeye 2026-03-28 | 13/650 |
|
|
[考研] 318求調(diào)劑 +3 | 篤行致遠. 2026-03-31 | 3/150 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +4 | 崔wj 2026-03-31 | 4/200 |
|
|
[考研] 調(diào)劑 +4 | GK72 2026-03-30 | 4/200 |
|
|
[考研] 304求調(diào)劑 +6 | 曼殊2266 2026-03-27 | 6/300 |
|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +8 | 邱gl 2026-03-27 | 8/400 |
|
|
[考研] 324求調(diào)劑 +5 | hanamiko 2026-03-26 | 5/250 |
|