This is a general C function prototype syntax question regarding the following scenario:
if I have a project with 3 source files
Main.c // main project source file that calls functions in a2d.c
a2d.h // A/Ddefinitions & function prototypes
a2d.c // A/D Access routines
a2d.c requires #include a2d.h for the definitions
Main.c requires #include a2d.h for the funcion prototypes
should the prototypes for the A/D functions be declared as
1.) char ReadA2D(char);
or do they have to be phrased as:
2.) char ReadA2D(char anyVariableName)
I always thought either was ok but I get an "Illegal symbol" error on the prototype line when I compile if I use option 1. What I find funny is that "anyVariableName" does not have to be the same variable name used in the actual function definition.
Is my understanding, of how to use #defines and prototypes in a .h file in conjunction with separate source files that all require the .h file to be included, wrong? If so what is the proper form/syntax?