I want a menu from which you choose some action.
Problem is that when we choose one, and press the \"return\" key, the user input command which should have been the
scanf("%d",&choice);
This leaves the newline ('\n') in the standard input buffer stdin.
Your call of gets() merely consumes that whitespace, writing nothing into name.
To prevent this, consume the newline char after you call scanf, for instance by using getchar(). If you are not on a microsoft platform, please do not use fflush(stdin), as that is undefined behavior (on non-MS platforms).