I am trying to input a group of words from a text file. I can only get the first word and it ignores the rest...what is the problem?
My input file is called "patterns.txt". As an example, lets say it contains the words (Big House). When I run the code below, it returns Big only...why? and how can I fix this?
int main()
{
char pattern[50];
//open the file for reading
ifstream pattern_file("patterns.txt");
pattern_file>>pattern;
//for debugging purposes only
cout<<"the file patterns.txt contained the pattern: "<<pattern<<"\n";
//close the file after reading in the pattern
pattern_file.close();
return 0;
}
pls help...