简体   繁体   中英

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

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. Assuming this, rather than writing

int ATTRIBUTES;

which will declare a variable of type int, named ATTRIBUTES, try either

typedef int ATTRIBUTES;

which says "whenever ATTRIBUTES is used as a type, it means int instead", or

#define ATTRIBUTES int

which is slightly cruder, and replaces all instances of ATTRIBUTES with int, textually, before compilation.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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