Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "ISO C forbids forward parameter decleration" when passing a struct pointer to a function?

Tags:

c

I have the following code, the struct declaration is before the main, so is the function declaration

struct stuff{
        int sale_per_day[Kdays];
        int max_sale;
        };

void set_max();

and that part is in the end...

void set_max(struct stuff *point; int n = 0)
{
return;
}

Now what exactly am I doing wrong? I get the

"ISO C forbids forward parameter declaration"

error. I am working with GCC C89 as per the course demands.

like image 527
YNWA Avatar asked Aug 14 '26 09:08

YNWA


1 Answers

It looks as if it just needs a comma instead of a semicolon:

void set_max(struct stuff *point, int n = 0)
like image 90
Mark Wilkins Avatar answered Aug 16 '26 22:08

Mark Wilkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!