2014-10-19 63 views
-3
#include <stdio.h> 
#include <stdlib.h>  
#include <math.h> 

typedef struct tagPoint 

{  
double x, y; 
} point, *pPoint; 

typedef struct tagSource 
{  
point location;  
float power; 
} source, *pSource; 

typedef struct 

{ 


{ 
    struct tagSource tagSource[100],random [2]; 
     struct tagPoint}; 

double spl(double w, double r); 
double spl_total(struct tagSource *srcs, int count, struct tagPoint dest); 
double distance(struct tagPoint p1, struct tagPoint p2); 
double power(double w); 
int sort(struct tagSource *srcs, int count); 
int display(struct tagSource *srcs, int count); 


int main (int argc, char *argv[]) 
{ 

错误消息如下:C:15:预期说明符限定符列表前“{”令牌C编程错误:之前预计符限定符列表“{”

我试图查找如何解决这个问题,但我处于死胡同。请帮我修补这个。由于

+0

您应该改进您的代码格式。为什么你没有用对应的'}'关闭最后一个''''?与第19行相同。 – ericbn 2014-10-19 14:05:46

+0

第15行是'} source,* pSource;'是吗? – 2014-10-19 14:06:47

+0

请在发布之前清理你的代码,这是一个完整的混乱。 – 2014-10-19 16:33:39

回答

0

至少可以说变化:

int main (int argc, char *argv[]) 
;{ 

int main (int argc, char *argv[]) 
{ 
+0

它仍然读取相同的错误 – Rico 2014-10-19 14:03:11

0

你不能有功能的签名后定义一个分号。所以你只需要在int main (int argc, char*argv[])之后删除;

0
typedef struct 

{ 


{ 
    struct tagSource tagSource[100],random [2]; 
     struct tagPoint}; 

这里有两个{。删除其中任何一个。另外,更改

int main (int argc, char *argv[]) 
;{ 

int main (int argc, char *argv[]) 
{ 

完成这些修改后,错误将会消失!

相关问题