using linked list or somthing..
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.
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/
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.