| 查看: 1857 | 回復(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 /*參考壓強(qiáng)*/ 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,而只是一個框架,可以用來擴(kuò)展功能的。 你看到的那個資料上沒有更詳細(xì)的說明么? |
銅蟲 (正式寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿上海海洋大學(xué)083200食品學(xué)碩,求調(diào)劑,接受其他專業(yè) +6 | what張 2026-04-01 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 321求調(diào)劑 一志愿 浙江工業(yè)大學(xué)生物醫(yī)藥 +5 | 嘿嘿HC 2026-04-01 | 6/300 |
|
|
[考研] 279求調(diào)劑 +4 | 傅文秋 2026-04-02 | 4/200 |
|
|
[考研] 一志愿復(fù)旦材料,英一專碩,總分357調(diào)劑 +3 | 1050389037 2026-04-02 | 4/200 |
|
|
[考研] 290求調(diào)劑 +3 | 1314捧花 2026-04-02 | 3/150 |
|
|
[考研] 材料專業(yè)求調(diào)劑 +10 | 月月鳥木 2026-04-01 | 10/500 |
|
|
[考研] 一志愿安徽大學(xué)計算機(jī)科學(xué)與技術(shù)學(xué)碩,331分求調(diào)劑 +5 | 蔣昌鵬qtj 2026-04-01 | 5/250 |
|
|
[考研] 求調(diào)劑0703 +5 | 周嘉堯 2026-03-31 | 8/400 |
|
|
[考研] 材料科學(xué)與工程339求調(diào)劑 +11 | hyz0119 2026-03-31 | 12/600 |
|
|
[考研] 安徽大學(xué)專碩生物與醫(yī)藥專業(yè)(086000)324分,英語已過四六級,六級521,求調(diào)劑 +10 | 美味可樂雞翅 2026-03-26 | 12/600 |
|
|
[考研] 326求調(diào)劑 +4 | 崽崽仔 2026-03-31 | 4/200 |
|
|
[考研] 085601英二數(shù)二求調(diào)劑 總分325 +4 | 余航航 2026-03-31 | 4/200 |
|
|
[考研] 266分,求材料冶金能源化工等調(diào)劑 +8 | 哇呼哼呼哼 2026-03-27 | 10/500 |
|
|
[考研] 22408 359分調(diào)劑 +4 | Qshers 2026-03-27 | 8/400 |
|
|
[考研] 11408總分309,一志愿東南大學(xué)求調(diào)劑,不挑專業(yè) +5 | 天賦帶到THU 2026-03-29 | 6/300 |
|
|
[考研] 291求調(diào)劑 +5 | Y-cap 2026-03-29 | 6/300 |
|
|
[考研] 356求調(diào)劑 +3 | gysy?s?a 2026-03-28 | 3/150 |
|
|
[考研] 復(fù)試調(diào)劑 +3 | raojunqi0129 2026-03-28 | 3/150 |
|
|
[考研] 285求調(diào)劑 +4 | AZMK 2026-03-27 | 7/350 |
|
|
[考研] 292求調(diào)劑 +4 | 求求了收下我吧?/a> 2026-03-26 | 4/200 |
|