I should make a function that controls the insertion of an enum, if the insertion is correct it must do nothing, if it is wrong it must allow the user to re-insert it.

these are the portions of my code:

```
typedef enum {SHORT= 1, MEDIUM, LONG, OTHER} hair;

typedef struct{

...

hair type;

}record;

record subj[DIM_RECORD];

printf("\ntype= ");

printf("\n\t%d) SHORT",SHORT); //Output= 1)Short etc

printf("\n\t%d) MEDIUM",MEDIUM);

printf("\n\t%d) ILONG",LONG);

printf("\n\t%d) OTHER",OTHER);

isEnum(subj->type);

void isEnum(int* i){ 
  do { 
      scanf("%d", &i); 
      if (*i>=1 && *i <= 4) break; 
      printf("\nError"); 
      printf("\ntry again "); 
   }while(1); 
}

```

I don't understand where I'm wrong, any number I enter always gives me a error (Process finished with exit code -1073741819 (0xC0000005))