Wednesday, August 18, 2010

It Ain't Autumn Yet

While I was on the bus, a girl sat right next to me. Turns out I met this one before: Autumn Huston from my 4th and 5th grades. She drew a lot of manga in both classes; I drew very little (although I plan to learn). We didn't speak at all to each other on the bus, but it was interesting to see that she lost weight. A lot of weight. :x

#include <sstream>

void getTokens(string s, vector<string> &tkn) {

  while (s.find("  ") != string::npos) {
    int pos = s.find("  ");
    s.replace(pos, 2, " ");

  // turn the string into an input stream
  istringstream iss(s);

  //read one space-separated word from the input stream
  string word;
  iss >> word; // if successful, word contains one token
  while (s.find(word) != string::npos) {
    int pos = s.find(word), len = word.length();
    s.erase(pos, len);
    iss >> word;

No comments:

Post a Comment