Iwanted to create following table
struct tag{
String Card;
int Access;
}
tag Tags[3] = {{"xxxx",0},
{"yyyy",1},
{"zzzz",1}};
When I compile I get expected initialiser before Tags
Help:)
Iwanted to create following table
struct tag{
String Card;
int Access;
}
tag Tags[3] = {{"xxxx",0},
{"yyyy",1},
{"zzzz",1}};
When I compile I get expected initialiser before Tags
Help:)
Missing a semicolon
Needs a semicolon after the first closing brace.
The statement that defines the "tag" structure, and the statement that defines the Tags array, are separate statements.
silly me. thanks guys
If the Text does not change, consider using const char *
Also do you need a full int type or is the second member only a Boolean?
struct Tag {
const char * card;
bool accessEnabled;
};
Tag knownTags[]= { // let the compiler calculate the size
{"xxxx", false},
{"yyyy", true},
{"zzzz", true},
};
const size_t knowTagsCount = sizeof knownTags / sizeof * knownTags; // the number of entries in the array
(In arduino land members variable’s name start with a lowercase and camelCase is used ans classes’ name start with an uppercase)
I’d personally capitalise type and lowercase var name instead
Tag tags[3]