C expected expression before struct error

1

The keyword static is a keyword and does not need to be added when trying to call a function marked with static. See this for more information.

2

You also cannot implicitily convert a structure to another data-type. You are trying to do this in the print_abc function. You need to explicitly access the member variables.

3

&i and &d is not a valid placeholder to insert integers when using the printf function. Use %d instead, see this for more info.

The code should be:

struct abc{
int a;
int b;
int c;
};
static void print_abc(struct abc){
printf("%d %d %d",abc.a,abc.b,abc.c);
}

int main(void){
void print_abc(struct abc);
}

Leave a Comment