B
benn
Here's the setup...
Defines.h file contains:
enum DAY { monday, tueday };
DayFunctions.h contains prototype:
void printIsMonday ( enum DAY currentDay);
DayFunctions.c contains:
#include "Defines.h"
#include "DayFunctions.h"
void printIsMonday ( enum DAY currentDay)
{
if (currentDay == monday)
printf("Monday!");
}
Main.c contains:
#include "Defines.h"
#include "DayFunctions.h"
void main (void)
{
enum DAY eDayVariable;
eDayVariable = monday;
printIsMonday( eDayVariable);
}
The warning message the compiler gives for the prototype declaration
line in DayFunctions.h:
"
"enum DAY" declared inside parameter list. Its scope is only
definition or declartion, which is
probably not what you want. Parameter has incomplete type.
"
I tried removing the "enum" word from the prototype declaration, but
then it fails to compile because it
doesn't know what DAY is. What is the problem?!
Thanks!
Defines.h file contains:
enum DAY { monday, tueday };
DayFunctions.h contains prototype:
void printIsMonday ( enum DAY currentDay);
DayFunctions.c contains:
#include "Defines.h"
#include "DayFunctions.h"
void printIsMonday ( enum DAY currentDay)
{
if (currentDay == monday)
printf("Monday!");
}
Main.c contains:
#include "Defines.h"
#include "DayFunctions.h"
void main (void)
{
enum DAY eDayVariable;
eDayVariable = monday;
printIsMonday( eDayVariable);
}
The warning message the compiler gives for the prototype declaration
line in DayFunctions.h:
"
"enum DAY" declared inside parameter list. Its scope is only
definition or declartion, which is
probably not what you want. Parameter has incomplete type.
"
I tried removing the "enum" word from the prototype declaration, but
then it fails to compile because it
doesn't know what DAY is. What is the problem?!
Thanks!