How do I access a variable in a one C file from another?
I have two C files. I want to declare a variable in one, then be able to access it from another C file. My definition of the example string might not be perfect, but you get the idea.
//file1.c char *hello="hello";
// file1.h #ifndef FILE1_H #define FILE1_H extern char* hello; #endif // file1.c // as before // file2.c #include "file1.h" // the rest as before