Search code examples
cinputfgets

making fgets not print stuff like ^G or ^D caused by arrow keys or other control keys


Basically the title is self explaining. I'm programming in C and i use fgets as the input function but i do not want that control characters get printed.


Solution

  • fgets() is rather simple, and doesn't offer you much control over what appears on the screen. I don't think that it's possible to do this. You may want to look into something more powerful - like readline.