#include
typedef struct mystruct
{
void (*ExitFnPtr)(mystruct);
int a;
}mystruct;
int main()
{
mystruct M;
printf(\"Hello, World!\\n\"
There is nothing recursive with that.
Your problem is just that the definition of mystruct is not known until the end of the struct's definition.
Try
typedef struct mystruct
{
void (*ExitFnPtr)(struct mystruct ms);
int a;
} mystruct;
struct mystruct
is the same as mystruct
(you just typedef it), but known at that point in time.
You could also do a forward declaration if you don't want to change your original code (although it's not as readable as the above:
typedef struct mystruct mystruct;
typedef struct mystruct
{
void (*ExitFnPtr)(mystruct ms);
int a;
} mystruct;