I have a string: "The world is a beautiful place to live in."
.
I have two source files and a global header file. I can access the string in two easy ways:-
Declaring and defining a constant variable as shown: I can use it using
extern
const char *str = "The world is a beautiful place to live in.";
Using
#define STR "The world is a beautiful place to live in."
Out of the above two options, which one is preferred in C?