I have a header file that contains all the string command as shown below:
const char AT_RSSI[] = "ATRSSI\r\n";
const char AT_DEVICE_SECURITY[] = "ATDS";
But, using this method each of char sentence is appended with \0 at the end and this is inconvenient as I need to remove 1 char, each time I use the sizeof() method
There is another solution is to use
//header file
extern const char *AT_RSSI;
//some.c
const char *AT_RSSI = "ATRSSI\r\n";
and declare it in one of the .c file, but I do not like this approach. I want all my constant variable to be declared in the header file
May I know how can I declare a constant global variable char array that can be included in various .c file?