World Search with multifunction (?) caracter

Hy Guys!
I have a task to search any given world in multiply files and give back the line where it was found. Which seems easy but has a twist where any given world can contain a (?)mark caracter, which can be any caracter like (se?rch) and then i should find all the worlds like (search, sewrch seerch ect.)
Any idea?
(Sorry for the code-worlds its in my own motherlanguage)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
using namespace std;

typedef std::map<std::string, std::set<std::string> > data_t;
  data_t data;
void feldolgoz(data_t& data,istream & is)
{
	string line;

	while(getline(is, line))
	{
		data[line];

		std::istringstream ss(line);
		std::string s;

		while(ss >> s)
		{
			data.at(line).insert(s);
		}

	}
}

int main(int argc, char* argv[])
{
	
	data_t data;
    string keresendo=argv[1];
    ifstream f(keresendo.c_str());


    //cout<<keresendo<<endl;
	for(int i=2;i<argc;++i)
	{
		ifstream f(argv[i]);
		feldolgoz(data,f);
	}

	   for(data_t::const_iterator it=data.begin(),end=data.end();it!=end;++it)
    {
      if(it->second.count(keresendo))
     


		cout << "Talalat: " << it->first << endl;

    }



}
Topic archived. No new replies allowed.