Hi all, I am trying to reading stuffs from the text file, i don't know y but program can't read off the tab space
eg.
it reads
Hi HappyDay 325
but it can't read
Hi Happy Day 325
like where we used more than one spacing for one word or tab spacing
here is my code plz help me
void get_graph(string const &filename, NodeMap &node_map)
{
ifstream inf(filename.c_str());
string from, to;
double weight;
while(inf.good())
{
inf >> from >> to >> weight;
if ( inf.good() )
{
Node *Target = node_map.find_in_nodemap(to);
Node *Source = node_map.find_in_nodemap(from);
Edge *connector = new Edge(weight,Target);
Source->neighbors.push_back(connector);
}
}
}
int main()
{
NodeMap nodes;
ifstream inf;
string filename;
cout<<"Enter filename : ";
cin>>filename;
inf.open(filename.c_str());
get_graph(filename, nodes);
.
.
.
}