Recommended Answers
Jump to PostUse a std::map.
Create a map<std::string, int>.
Scan through the file and insert each of the word to the map with initial value 1. If the word already existed, increment its value.
Study the insertion example given on http://www.cplusplus.com/reference/stl/map/insert/
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.