How to read in newline or null-terminated words into a cstring array
Posted on 2005-03-06
Hello, I was wondering what would be a better technique to read in a file of newline-terminated words and place them into an array of cstrings. Do I have to read in each word char by char?
The text file is as such:
Say I create a struct to hold the char array:
...and I create an array of Type "HoldTheChars"
... and then use a double for-loop to fill in the array.
Is this the most efficient way?
Basically, I'd like to read in each word, as a cstring, and place it in an array, for future tests on how to search, binary or hashing.