Problem with passing a struct pointer

Morning All

I have some code in which I have declared a structure.
I want to pass a pointer to 1 of these structures to a function called 'DoDrip'.

As soon as I put the argument list into the function def I get a comp error:

'drip_struct_error:-1: error: variable or field 'DoDrip' declared void'

A cut down section of the code that shows the issue is below.

I'd be very greatfull if someone would tell me whats wrong please.
Many thanks for your time.

Phil

int ValvePin = 3;

  struct drip_struct{
    boolean active;
    int drip_delay;
    int drip_form_time;
    boolean GoNow;
    long int WaitUntil;
  } drip_1 = {1,0,30,0,0},
    drip_2 = {0,85,30,0,0},
    drip_3 = {0,85,30,0,0},
    drip_4 = {0,85,30,0,0};
    
    drip_struct* DripArray[] = {&drip_1,&drip_2,&drip_3,&drip_4};

void setup()
{
  
}
    
void DoDrip(drip_struct* drip_ptr)
{
    digitalWrite(ValvePin, HIGH);
 //   delay(drip->drip_form_time);
    digitalWrite(ValvePin, LOW);
}

void loop()
{
  
  
}

Hi,
the same problem has been discussed here:

http://arduino.cc/forum/index.php/topic,80277.0.html

Hi ea

Thanks for that.
Ive tried that and have a new problem.
The compiler doesn't like my use of boolean as a type !!!!!

I now get:

defs.h:6: error: 'boolean' does not name a type

Gurrrrrrr !!

Any ideas ??

Try bool.
Or add Arduino.h into your include file.

Hi AWOL

I just found that out !!!!!
bool works just fine.
Alternatively, I can include #include "WConstants.h" in my .cpp file. I tried that but its not in the distributed package.
No mind, bool works fine !

Thanks fore your help guys !!
Cheers
Phil

Alternatively, I can include #include "WConstants.h" in my .cpp file. I tried that but its not in the distributed package.

Not with 1.0, it isn't. Arduino.h is, though.