Вопрос

I am using a C program which takes file contents as input. I am using input redirection at the command line to read the file. Can I use getchar() to obtain the content of the file? Or should I be reading it into a certain array and then access it?

Это было полезно?

Решение

Yes sure you can use any method to read input from file while running program through command. You do not need to format it at all. the data in file should appear as if typed on command line while providing inputs. May be this helps. Please provide more insight if this does not help.Thanks

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top