error: struct has no member named X

Look at the first error message of the compiler. It should complain about the *char in line 6, which should be char *. By the way: always copy and paste error messages, so that we get the original messages.

Why and when to use static structures in C programming?

The static keyword in C has several effects, depending on the context it’s applied to. when applied to a variable declared inside a function, the value of that variable will be preserved between function calls. when applied to a variable declared outside a function, or to a function, the visibility of that variable or function is limited … Read more

typedef struct pointer definition

You cannot use pEDGE within the definition of the struct. You shoud do something like: You must also note that edge_item is a double pointer. You also mention that in your question. So if you use pEDGE_ITEM and you just want to have a normal pointer you should not write pEDGE_ITEM *edge_item but just pEDGE_ITEM … Read more

C Unknown type name ‘my_structure’

Because of how you’ve ordered your includes, the compiler sees void some_func(my_structure *x); before it sees typedef struct abcd { int a; } my_structure;. Let’s walk this through. Assuming my_struct.h is processed first, we get the following sequence of events: UTILSH is defined MAINH is defined Because UTILSH is already defined, we don’t process my_struct.h … Read more

too many initializers for ‘int [0]’ c++

In C++11, in-class member initializers are allowed, but basically act the same as initializing in a member initialization list. Therefore, the size of the array must be explicitly stated. Stroustrup has a short explanation on his website here. The error message means that you are providing too many items for an array of length 0, … Read more