Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHelp with basic C code
I want to be able to set the char variable (to be displayed on the LCD) from within the functions (named fx1 and fx2 here). I'm getting a 'expected expression before ']' token' error. I h...
Altera_Forum
Honored Contributor
14 years agoFirst, as mortenk said, your array has to have a size. then to assign a string to it, you will need to use strcpy or strncpy (safer) or memcpy.
char first_row ;
void fx1(void)
{
strcpy (first_row, "fx1"); // you should use strncpy here instead. I did not use it because I do not know what lib you are using.
}