Hello my problem is that I am not for sure my vector < vector < string > > addresses;
is correct. What I am looking for is to read in from a file which looks like:
name:dfsd@msn.com
name:dfsd@msn.com
name:dfsd@msn.com
Once my code parses through the file, addresses should look like:
0 1
0 [name][dfsd@msn.com]
1 [name][dfsd@msn.com]
2 [name][dfsd@msn.com]
3 [name][dfsd@msn.com]
I am not for sure if addresses.push_back(ads);, in the code below, will make the above possible. Here is the while loop:
while(!inputFile.eof())
{
//call seperateLine() to parse through the input
//seperateLine(input,addresses,lastName);
len = input.find(':', startPoint);
if (len == string::npos)
len = input.size() - startPoint;
else
len -= startPoint;
name = input.substr(startPoint, len);
ads.push_back(name);
addresses.push_back(names);
//ads.push_back(name);
for (int i=0; i < name.size(); i++)
tolower(name[i]);
len += 1;
end = input.size() - len;
addy = input.substr(len, end);
ads.push_back(addy);
addresses.push_back(ads);
getline(inputFile,input);
}
Thanks!