How to create an external character array in C?
I have tried various ways to define char cmdval[128] but it always says undefined reference to \'
char cmdval[128]
undefined reference to \'
You should have a compilation unit in which you define the cmdval variable. The extern keyword only declares that the variable exists, it does not define it.
cmdval
extern
Put the following line in first.c, second.c or in an other C file of your choice:
first.c
second.c
char cmdval[128];