fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. int main() {
  6.  
  7. char c_str[] = "Name = \"1234\"\r\n";
  8.  
  9. std::string str = c_str;
  10. std::istringstream stream(str);
  11.  
  12. std::string field;
  13. std::getline(stream, field, '"'); // skip to "
  14. std::getline(stream, field, '"'); // read
  15. std::cout << field << std::endl; // 1234
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
1234