Map of Vectors of strings

Hi,

I am new to this forum and to c++.

I am writing a program that will create a map of vectors with each key of the map referencing a vector of strings.

I am able to create the map but then when I try to access the contents - I am not able to...

The code I have written is pasted below. Within the function createMap, the map is correctly created. But outside of the while loop in the function processString, I get nothing. In fact, even if I have a generic bout statement after the while loop, it does not execute. Any advice?

Thanks,

========
Code
========

void createMap(string &s, string &st, Map<Vector<string> > & m)
{
m[s].add(st);

}

void processString(string &line, Map<Vector<string> > & m, int k)

int i=0;
string s, st;

while (cond)
{
if(i > line.length()) break;
else
{
s = line.substr(i,k);
st = line.substr(i+k,k);
createMap(s,st,m);
i++;
}
}
s= " the ";
cout << "Size of vector for the string " << s << "is = " << m[s].size() << endl;

}
Topic archived. No new replies allowed.