Simple C question.. I guess that I am blowing! Maybe I didn't get enough sleep last night....
Using AVR Studio 4.0 with GCC
1. I create a type that is a struct
2. I create multiple 'instances' of this type.
I get the following errors when I Build All:
menu.c:1729: error: expected declaration specifiers or '...' before 'offTimeStruct'
menu.c:1742: error: 'eventOff' undeclared (first use in this function)
typedef struct offTimeStruct
{
uint8_t endMinute;
uint8_t endHour;
};
offTimeStruct light1;
offTimeStruct rocket;
//menu.c: Line 1729
void CalculateOffTime(uint8_t duration, offTimeStruct &eventOff)
{
//menu.c: Line 1742
eventOff.endMinute = 1;
}
funtion call from Main()
CalculateOffTime(1, light1);
Thanks for your ideas guys!Message
typedef Structs pass by reference
2013-02-02 by englsprogeny1
Attachments
- No local attachments were found for this message.