+ 1
Searching a file, line by line, to find an exact copy of a string array
I have a string array of Morse code from a to z, and 0 to 9. The user types a phrase and it converts it to Morse code, then I have to see if that exact copy of the phrase is in the file.
3 Réponses
+ 3
What language are you doing this in?
+ 3
For c++ you can do something like this using
Use ifstream to read data from a file:
std::ifstream input( "filename.ext" ) then do a loop like so for( std::string line; getline( input, line ); )
{
...for each line in input...
}
0
oh. c++, new to this