Hi all,
I would like to clarify that I want general answers and ideas so I can THINK about how to use it in my code. I will NOT post any code since it is an assignment.
I'm having a problem with reading into a character array from a file which consists of a list of single characters (all letters from the alphabet). All that is going on is that it is reading control characters such as \r into the array as well, which messes up the results when the array is used in a later function.
I have used fflush() before to remove unwanted newlines in console input into a char array, but that doesn't seem to work in my function to read data into the array from a file.
Thanks!
I would like to clarify that I want general answers and ideas so I can THINK about how to use it in my code. I will NOT post any code since it is an assignment.
I'm having a problem with reading into a character array from a file which consists of a list of single characters (all letters from the alphabet). All that is going on is that it is reading control characters such as \r into the array as well, which messes up the results when the array is used in a later function.
I have used fflush() before to remove unwanted newlines in console input into a char array, but that doesn't seem to work in my function to read data into the array from a file.
Thanks!