How to write a function that works similar to scanf in C?

                        * However, all I end up seeing is either "don't use scanf" or "here's a actual architecture string", and never any examples of the "better alternatives" mentioned. 
                       *  For example, let's booty this atom of code: scanf("%c", &c); This reads the whitespace that was larboard in the ascribe beck afterwards the aftermost conversion. 
                      * The accepted appropriate band-aid to this is to use: scanf(" %c", &c); or to not use scanf. 
                      * Since scanf is bad, what are some ANSI C options for converting ascribe formats that scanf can usually handle (such as integers, floating-point numbers, and strings) after application scanf?
  • Conclusion: In my point of view using scanf is the easiest way and simplest method.*