#include <cmath>
const int SIZE=8;
const double PI=3.1415926;int main()
{
float DctPara[SIZE][SIZE];
unsigned char Data[SIZE][SIZE]={{124,123,122,121,120,119,118,117},
{21,22,23,24,25,26,27,28},
{54,55,56,57,58,59,60,61},
{12,13,14,15,16,17,18,19},
{233,234,235,236,237,238,239,240},
{222,223,224,225,226,227,228,229},
{1,2,3,4,5,6,7,8},
{141,142,143,144,145,146,147,148}};
int i,j;
float temp[SIZE];
float *p;


float *dct(float Row[SIZE],int N);
float cp(int u);


for(i=0;i<SIZE;i++)
{
for(j=0;j<SIZE;j++)
temp[j]=Data[i][j];
p=dct(temp,SIZE);
for(j=0;j<SIZE;j++,p++)
DctPara[i][j]=*p;
}

for(j=0;j<SIZE;j++)
{
for(i=0;i<SIZE;i++)
temp[i]=DctPara[i][j];
p=dct(temp,SIZE);
for(i=0;i<SIZE;i++,p++)
DctPara[i][j]=*p;
}

float *dct(float Row[SIZE],int N)

int x;
int u;
float t=0;

float *temp1=new float[N];
for (u=0;u<N;u++)
{
for (x=0;x<N;x++)
t+=Row[x]*cos((2*x+1)*u*pi/2/N);
temp1[u]=t*cp(u)*sqrt(2.0/N);
t=0;
}
return temp1;
}

float cp(int u)
{
float x;
if (u==0)
x=1.0/sqrt(2);
else 
x=1;
return x;
}

return 0;
}
Compiling...
dct.cpp
D:\programming\dct.cpp(45) : error C2601: 'dct' : local function definitions are illegal
D:\programming\dct.cpp(62) : error C2601: 'cp' : local function definitions are illegal
Error executing cl.exe.dct.obj - 2 error(s), 0 warning(s)
谢谢