title: How to send data from char array to istream in class C++
body: <p>i want to send data f char array from main function to a istream member of a class as following code:</p>
  
  <pre><code>class StreamClass {
      public:
          std::shared_ptr&lt;std::istream&gt; istream_ptr;
  };
  int main(){    
      StreamClass sc;    
      char charArray[] = "hello world";
      sc.istream_ptr = std::make_shared&lt;std::istream&gt;(nullptr);   
  }
  </code></pre>
  
  <p>i read this link <a href="https://stackoverflow.com/questions/7781898/get-an-istream-from-a-char">Get an istream from a char*</a> . However i want to do it without coding anything manually , just using simple std functions. is it possible.</p>