VC 函数原型:
int Fit(char *keyword, double Abest[], double &q, int &kk, double &Sse0,double &Rsqrt,double *Xvector,double *Yvector, int nVector,double *W, int nMju, int nGNtimes, double GNer)
其中 *Xvector,*Yvector 是开辟的一片double型内存空间,大小为nVector*sizeof(double)(nVector 为int型变量)。
Double Abest[5]:返回值之一,是一维的double型数组,大小为5。
目前我程序中声明的函数及赋值如下:
function Fit(var keyword: pchar; var Abest: array of double;
var q: Pdouble; var kk: Pinteger; var Sse0, Rsqrt: Pdouble; Xvector:pdouble;
Yvector:pdouble; nVector: Cardinal; W:pdouble; nMju,
nGNtimes: Cardinal; GNer: Double): Integer;
其中
Xvector,yvector: pDouble;
GetMem(Xvector, sizeof(Double) * nVector);
GetMem(yvector, sizeof(Double) * nVector);
传值时传入的是Xvector,Yvector的首地址。
其他的 double型赋值操作为
a := 0.5;
b := @a ; (b为pdouble型)现在调用时总提示无效的浮点数操作。不知为何?比较急,先送100分,得到正确答案后再有200分送上,谢谢!
int Fit(char *keyword, double Abest[], double &q, int &kk, double &Sse0,double &Rsqrt,double *Xvector,double *Yvector, int nVector,double *W, int nMju, int nGNtimes, double GNer)
其中 *Xvector,*Yvector 是开辟的一片double型内存空间,大小为nVector*sizeof(double)(nVector 为int型变量)。
Double Abest[5]:返回值之一,是一维的double型数组,大小为5。
目前我程序中声明的函数及赋值如下:
function Fit(var keyword: pchar; var Abest: array of double;
var q: Pdouble; var kk: Pinteger; var Sse0, Rsqrt: Pdouble; Xvector:pdouble;
Yvector:pdouble; nVector: Cardinal; W:pdouble; nMju,
nGNtimes: Cardinal; GNer: Double): Integer;
其中
Xvector,yvector: pDouble;
GetMem(Xvector, sizeof(Double) * nVector);
GetMem(yvector, sizeof(Double) * nVector);
传值时传入的是Xvector,Yvector的首地址。
其他的 double型赋值操作为
a := 0.5;
b := @a ; (b为pdouble型)现在调用时总提示无效的浮点数操作。不知为何?比较急,先送100分,得到正确答案后再有200分送上,谢谢!
解决方案 »
- 奇怪的非模态对话框问题
- VC++中如何动态创建一个灰度图片??
- 关于GetClientRect函数??好奇怪!!
- 当鼠标移开时,如何去掉CListCtrl的自动的框选多行(造成多行有阴影背景,很难看)?
- 简单的问题 引用别人的库文件 到底怎么做?
- 带参数能正常执行,不带参数崩溃
- 为什么我获取记录老出错!!!ADO
- 如何实现控件的Font属性?
- 请问如何实现:鼠标左键释放后才执行 点击Picture 的操作?
- 怎么样用CFile读取BIOS后缀名为.rom的存档文件,在客户区显示.
- 弱弱的问问,来捡分了啊!!!!
- XP下正常,VISTA下程序退出出现(NTDLL.DLL): 0xC0000005: Access Violation的问题
function Fit(var keyword: pchar; Abest:Pdouble;
var q: Pdouble; var kk: Pinteger; var Sse0, Rsqrt: Pdouble; Xvector:pdouble;
Yvector:pdouble; nVector: integer; W:pdouble; nMju,
nGNtimes: integer; GNer: Double): Integer;