??? 05/24/12 16:08 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#187509 - Whats wrong with a header file? Responding to: ???'s previous message |
In file "messages.h"
extern const char msg1[]; ... extern const char msg255[]; In file "messages.c" const char msg1[] = "Hello"; ... const char msg255[] = "Goodbye"; You can #include "message.h" in as many modules as you like and compile and link message.c just once. |
Topic | Author | Date |
const strings in C | 01/01/70 00:00 | |
Does not compile | 01/01/70 00:00 | |
my question was | 01/01/70 00:00 | |
Common to play with #define EXTERN | 01/01/70 00:00 | |
Common doesn't mean recommended | 01/01/70 00:00 | |
well I recommend it | 01/01/70 00:00 | |
No - not hard to maintain at all | 01/01/70 00:00 | |
C strings | 01/01/70 00:00 | |
Whats wrong with a header file? | 01/01/70 00:00 | |
nothing wrong, double work | 01/01/70 00:00 | |
It works, and has advantages | 01/01/70 00:00 | |
I got in a total absolute magnificent mess | 01/01/70 00:00 | |
thanks to everyone, and next question is | 01/01/70 00:00 | |
about (tables of) pointers to const strings | 01/01/70 00:00 | |
C++ and style | 01/01/70 00:00 |