Hello guys I'm facing some problems on the lexical analysis of my compiler I had declared the following pointer
char *words[29]={
"program",
"label",
"integer",
"word",
"char",
"byte",
"shortint",
"logint",
"real",
"single",
"double",
"string",
"boolean",
"var",
"procedure",
"function",
"begin",
"end",
"if",
"then",
"else",
"or",
"and",
"div",
"not",
"do",
"while",
"mod"
};
char message[30];
and then I tried to use it in a function
for(handle=0;(&words[handle] != NULL);handle++)
{
message = &words[handle];
if(!strcmp(token,message))
message='words';
}
But I'm receiving the following errors when trying to execute:
regarding (line message = &words[handle];) : warning C4047: '=' : 'char [30]' differs in levels of indirection from 'char ** '
regarding (line message = &words[handle];) : error C2106: '=' : left operand must be l-value
regarding (line message='words';) : error C2015: too many characters in constant
regarding (line message='words';) : error C2106: '=' : left operand must be l-value
can't I work with pointers that way? Do you have any suggestions?