For example, a constant defined in main2.c is not visible in any other of the files! How can I make a constant global?!? I thought a constant was ALWAYS global!Originally Posted by Salem
If I compile main2-c out of a project, ALL files compile fine; but if I add all files into a project, when I try compiling main.c the compiler complains about test.c not finding declaration for a global constant defined in main.c !
But main.c starts with:
#include "test.c"
#include "function.c"
#include "test.h"
Actually my program is the only one where I've ever seen .C files included... so there should be something I don't understand here...
Let's summarize:
test.h holds the structure to read test.txt configuration file;
test.c holds the procedure to read the conf file;
function.c holds functions which use parameters read from test.txt;
main2.c should call functions in function.c and display the values they return.
So, how should I organize my sources into a project?? Which #include statement should I use, and WHERE?