ifstream ignoring characters
is there a way to have the >> operator of fstream ignore special characters other than whitespaces. I would like to have it ignore ',' and ';' and I just wanna make sure I don't have to write my own routine for it.
While there might be better ways to do this, I would read the file into a std::string, and then use boost tokenizer to break it up into the segments you want. I don't know of another way to do it, but I hope to see some clever alternatives.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement