hi, i have to read a file containing email addresses of different people in following format
name@domain.com:40
after reading i have to maintain 4 arrays
1: email domain
2: email name
3: email title
4: number of visits e.g in above example number of visits is 40,
You don't need four arrays, let alone a 3D array - one is enough:
Use a class similar to this one:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class EMailAddress
{
public:
EMailAddress(const std::string& str)
{
//split string here using getline, boost::string::split or similar
}
//getters
[...]
private:
std::string name;
std::string domain;
int visits;
};
When reading the file, store the addresses in a vector of that class.