Check out example codes for "convert string to stream c++". It will help you in understanding the concepts better.

Code Example 1

// stringstream::str
#include <string>       // std::string
#include <iostream>     // std::cout
#include <sstream>      // std::stringstream, std::stringbuf

int main () {
  std::stringstream ss;
  ss.str ("Example string");
  std::string s = ss.str();
  std::cout << s << '\n';
  return 0;
}

Learn ReactJs, React Native from akashmittal.com