Reading characters into array

Im looking to produce a simple program in C which will read characters from a file and store them into an array depending on there ascii values.

What will be the easiest way to impliment something like this. Would it be best to use:

fget
fgetc
etc......

Any help would be appreciated.

Thanks

Comments

  • fgets() or fscanf()... doesn't matter really. fgets() is perhaps the best one, since you could use that one for file handling as well as safe console input, instead of using scanf, which isn't safe.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion