Files Processing
StringStreams Processing
keywordsCounting.cpp
Define a function that, given an istream& and a const vector
Print in the order of ascending keyword.
Run the program on a text file with at least 10000 lines looking for no fewer than 10 keywords.
1
StringStreams Processing
Function Prototype:
map
keysCount(istream&, const vector
2
Execution of the Program
1) Write the program
keywordsCounting.cpp with at least two functions keywordsCounting
2) Prepare keywords and text2search for the keywords and for the text file.
3) Execution:
keywordsCounting keywords text2search result
4) Check result
3
Input String Operations
istringstream sin(string);
string read operations are identical to cin operations.
An example:
string word; while (sin>>word) …
Note
Algorithm: find an element in a container
Return iterator to the element found,
else return end() if no element is found.
An Example:
vector
vector
(x=find(a.begin(),a.end(),value)) != a.end()
/docProps/thumbnail.jpeg