K
KidLogik
Hello!
I am using std::stringstream && std::string to parse a text file ->
std::ifstream in;
std::string s;
std::streamstring ss;
int n;
I grab each line like so -> std::getline(in,s);
I then do this to get the string into a stringstream -> ss << s;
I am using a std::stringstream because it makes extracting data easier
like so -> ss >> n;
Is this the proper way to use std::stringstream? How do I blank out
the std::stringstream object because each time I do a (ss << s
the
stream keeps concatenating onto itself...how do I blank out the stream
to add a new string to it?
Thanks.
I am using std::stringstream && std::string to parse a text file ->
std::ifstream in;
std::string s;
std::streamstring ss;
int n;
I grab each line like so -> std::getline(in,s);
I then do this to get the string into a stringstream -> ss << s;
I am using a std::stringstream because it makes extracting data easier
like so -> ss >> n;
Is this the proper way to use std::stringstream? How do I blank out
the std::stringstream object because each time I do a (ss << s
stream keeps concatenating onto itself...how do I blank out the stream
to add a new string to it?
Thanks.