D
derrick
But its not working for me.
here is my code... and I know it is something so basic that I will be
embarrassed when I am corrected.. Thanks for your patience. It compiles ok,
and I can give it a string to parse, but when I execute parse it returns
nothing... Any help is greatly appreciated.
# include <string>
# include <iostream>
using namespace std;
std::string::size_type start=0, end=0;
std::string s;
std::string wordlist;
string parse(string)
{
start = s.find_first_not_of(" .,;!?");
end = s.find_first_of(" .,;!?", start);
string wordlist( s, start, end - start );
s.erase (start, end - start);
return(wordlist);
}
int main()
{
getline(cin, s);
parse(s);
cout << wordlist;
getline(cin, s);
}
here is my code... and I know it is something so basic that I will be
embarrassed when I am corrected.. Thanks for your patience. It compiles ok,
and I can give it a string to parse, but when I execute parse it returns
nothing... Any help is greatly appreciated.
# include <string>
# include <iostream>
using namespace std;
std::string::size_type start=0, end=0;
std::string s;
std::string wordlist;
string parse(string)
{
start = s.find_first_not_of(" .,;!?");
end = s.find_first_of(" .,;!?", start);
string wordlist( s, start, end - start );
s.erase (start, end - start);
return(wordlist);
}
int main()
{
getline(cin, s);
parse(s);
cout << wordlist;
getline(cin, s);
}