简体   繁体   English

基本语法错误无法修复?

[英]Basic Syntax Error Unfixable?

   int ATTRIBUTES;
   ATTRIBUTES* addRelation(char*,char*,ATTRIBUTES*);
   void nattr(ATTRIBUTES*);
   void tuplelen(ATTRIBUTES*);
   void infattr(char*,ATTRIBUTES*);
   void addValues(ATTRIBUTES*,char*);
   int count(VALUES*);
   void project(ATTRIBUTES*,char*);
   void select(char*,char*,char*,ATTRIBUTES*);
   int inStringArray(char[]**,int,char*);

At first I thought it was a point issue that I lacked declaration so I just declared ATTRIBUTES with or without the declaration it still gives me the errors below 起初我以为这是我没有声明的重点问题,所以我只声明了ATTRIBUTES,不管有没有声明,它仍然给我以下错误

Does anyone see something I'm missing or is it not possible for my program to work this way ? 有人看到我缺少的东西吗,或者我的程序无法以这种方式工作? Below you can see the lines in which each error is occurring I'm pretty sure my syntax is correct so I'm stuck on stupid as to whats missing .. Anyone see something I don't ? 在下面,您可以看到在其中发生每个错误的行,我很确定自己的语法是正确的,因此我对丢失的内容一无所知。.有人看到我没看到的东西吗?

[update from comment] [评论更新]

prototypes.h:2:11: error: expected '=', ',', ';', 'asm' or 'attribute' before '' token prototypes.h:3:22: error: expected ')' before '' token     
prototypes.h:4:25: error: expected ')' before '*' token prototypes.h:5:20: error: expected declaration specifiers or '...' before

From the looks of your code, you want ATTRIBUTES to be synonymous with int. 从代码的外观看,您希望ATTRIBUTES与int是同义词。 Assuming this, rather than writing 假设这,而不是写作

int ATTRIBUTES;

which will declare a variable of type int, named ATTRIBUTES, try either 它将声明一个int类型的变量,名为ATTRIBUTES,请尝试

typedef int ATTRIBUTES;

which says "whenever ATTRIBUTES is used as a type, it means int instead", or 上面写着“每当将ATTRIBUTES用作类型时,则表示int”,或者

#define ATTRIBUTES int

which is slightly cruder, and replaces all instances of ATTRIBUTES with int, textually, before compilation. 稍微粗略一些,在编译之前,将所有ATTRIBUTES实例替换为int,从文本上看。

Without looking at the whole file, I cannot diagnose any other errors you might be having, however that should fix at least a good proportion of the errors you're seeing. 如果不查看整个文件,我将无法诊断您可能遇到的任何其他错误,但是,这至少可以修复您看到的大部分错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM