have the folllowing code and error shows up when i run it. it says that e2316 '__fastcall TForm1::Selectd(float a[], int i,int j,int k)' is not a member of Tform1. anyone knows why i cant run the program?
float __fastcall TForm1::Selectd(float a[], int i,int j,int k) //select median (selection by partition)
{
if(i<=j)
{
int p=Partitiond(a,i,j);
if(p>(k) )
return Selectd(a,i,(p-1),k);
else if (p<(k ) )
return Selectd(a,p+1,j,k);
else
return a[p];
}
}
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "WMPLib_OCX"
#pragma link "imageenview"
#pragma link "imageenproc"
#pragma link "histogrambox"
#pragma link "ieview"
#pragma link "hvideocap"
#pragma link "imageenproc"
#pragma resource "*.dfm"
int a;
int b;
int i;
int j;
int k;
float p[10];
float med;
int h;
int __fastcall TForm1::Partitiond(float a[] ,int i,int j)
{
int val=a[i];
int h=i;
for (int k=(i+1);k<=j;k++)
{
if (a[k]<val)
{
h=h+1;
//swap a[h],a[k]
int temp=a[h];
a[h]=a[k];
a[k]=temp;
}
}
//swap a[h],a[i]
int temp=a[h];
a[h]=a[i];
a[i]=temp;