Will(95367158) 16:56:05
有谁指点一下下面的程序啊
Will(95367158) 16:56:14
#include "math.h"
#define pi 3.1416
#define Point 1024
float x1r[Point],*x1i[Point]={0};
float x2r[Point],x2i[Point]={0};
void multi( int N,float *x1,float *x2);
void put_in(int N,float *x1,float *x2);
void FFT(int N,float *xr,float *xi,int ntype);
//数据处理程序
void dataprocess()
{
int i;
//上游信号fft变换后取共轭
void put_in(Point,float *x1r,float *x1i);
void FFT(Point,float *x1r,float *x1i,1);
for (i=0;i<Point;i++)
{
*x1i[i]=-*x1i[i];
}
//下游信号fft变换
void put_in(Point,float *x2r,float *x2i);
void FFT(Point,float *x2r,float *x2i,1);
//上下游信号相乘后取IFFT变换
void multi(Point,float *x1r,float *x2r);
void FFT(Point,float *x1r,float *x1i, -1);
}
//输入子程序
void put_in(int N,float *x1,float *x2)
{
int i;
float p=3.1416;
for(i=0;i<N;i++)
{
x1[i]=cos(p*i*i/N);
x2[i]=0;
}
}
void multi( int N,float *x1,float *x2)
{
int j,i=0;
float t;
for(j=0;j<1024;j++)
{
t=x1[i];
t=x2[i]*t;
x1[i]=t;
i++;
}
}
Will(95367158) 16:56:32
编译后
Will(95367158) 16:56:50
[2812_DataProcess.c] "E:\ccs3.3\C2000\cgtools\bin\cl2000" -g -fr"C:/Users/will/Desktop/2812 project ngguan_flowmeter_6/Debug" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"../Debug.lkf" "2812_DataProcess.c"
"2812_DataProcess.c", line 36: error: expected a type specifier
"2812_DataProcess.c", line 37: error: expected a type specifier
"2812_DataProcess.c", line 37: error: expected a type specifier
"2812_DataProcess.c", line 44: error: declaration may not appear after executable statement in block
"2812_DataProcess.c", line 44: error: expected a type specifier
"2812_DataProcess.c", line 45: error: declaration may not appear after executable statement in block
"2812_DataProcess.c", line 45: error: expected a type specifier
"2812_DataProcess.c", line 45: error: expected a type specifier
"2812_DataProcess.c", line 48: error: declaration may not appear after executable statement in block
"2812_DataProcess.c", line 48: error: expected a type specifier
"2812_DataProcess.c", line 49: error: declaration may not appear after executable statement in block
"2812_DataProcess.c", line 49: error: expected a type specifier
"2812_DataProcess.c", line 49: error: expected a type specifier
13 errors detected in the compilation of "2812_DataProcess.c".
>> Compilation failure
Compile Complete,
13 Errors, 0 Warnings, 0 Remarks.
Will(95367158) 16:57:11
哪位大侠指导一下
Will(95367158) 16:57:20
想了好久,改不动了
Will(95367158) 17:00:11<
关于函数数组指针混乱之战-qq群求助+解答
最新推荐文章于 2021-03-18 19:24:55 发布
博客作者在QQ群中求助,遇到了C语言编程中关于函数数组指针的问题,代码编译出现多个错误。经过讨论,问题主要集中在函数调用和数组定义上。错误包括类型声明缺失、变量声明位置不当等。群友提供了修改建议,如去掉函数调用前的`void`,修正数组定义等,但作者在不同编译环境下仍遇到问题。
摘要由CSDN通过智能技术生成