using linked list or somthing..

VernonDozier commented: No effort. -6

Recommended Answers

All 2 Replies

Haha dude. Did you even try?

Use 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/

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.