質問

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