I am writing a lexer and I am using an array to strore the keywords and reserved words:
string keywords[20] = {
"function",
"if",
"while",
"halt",
};
I am trying to use :
bool isKeyword(string s)
{
return find( keywords.begin(), keywords.end(), s ) != keywords.end();
}
but I am getting the error: "error: request for member 'end' in 'keywords', which is of non-class type 'std::string [20] {aka std::basic_string [20]}"