C expected expression before struct error


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.


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.


&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);

Browse More Popular Posts

Leave a Comment