i am stuck in a prog. and i want your help...
I would like a data structure type (map, set, vector, list etc) that takes string, and allows me to seach in it...
Cause my english may not be good enough to understand, i will give you an example...
i have 2 txt files, and i want to see which words of file 2 are in file 1 and how many times are there...
example:
file 1.
i am new c++ learner, i am trying to learn.
file 2.
i
learner
am
So i want the results to be:
i (2 times)
am (2 times)
learner (1 time)
Can you tell me how can i do that? can you gine me an example?
Try looking at the documentaion on the STL containers, http://www.cplusplus.com/reference/stl/
These can all hold strings and you shoudl be able to find the one to best suit your need from the descriptions (it is worth reading all of them even when you think you have found what you need, as it will save time in the future when you next need a container class).
If you need additional help on using one of them please ask :-)