int v;sscanf(s, "%d ml of", &v);size_t p = s.find(',');int m;sscanf(s.substr(p+2, s.length()-p).c_str(), "weighing %d", &m);