title: Why am i getting error when i try to assign string to istringstream object in visual studio in c++?
body: <p>The following class takes a <code>string</code> line as input from the user. My aim is to store it in the <code>istringstream iss</code> and then to extract various data from the <code>istringstream iss</code> into various variables. But, when I try to initialize <code>iss</code> with <code>string user_input</code>, I am getting this error when I compile the file:</p>
  <blockquote>
  <p>error C2064: term does not evaluate to a function taking 1 arguments</p>
  </blockquote>
  <p>I think the problem is in the line <code>iss{user_input};</code> Please explain why I am getting this error.</p>
  <p><code>_input.h</code> header file</p>
  <pre class="lang-cpp prettyprint-override"><code>#pragma once
  
  #include &lt;string&gt;
  #include&lt;sstream&gt;
  #include &quot;_date.h&quot;
  #include &quot;_time.h&quot;
  
  using namespace std;
  
  //definition of class input
  class _input
  {
      string user_input;
      istringstream iss;
  
      //datamembers to be sent
      int esno,eday, emonth, eihours, eimins, eohours, eomins, emo;
      char eiap, eoap;
      string enotes;
  
  public:
      _input();
  
      void get_input();
      void process_data();
  };
  </code></pre>
  <p><code>_input.cpp</code>  file</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &quot;_input.h&quot;
  
  _input::_input() : user_input { &quot;Nothing Entered&quot; }, iss{ &quot;&quot; }, esno{ 0 }, eday{ 0 }, emonth{ 0 },
        eihours{ 0 }, eimins{ 0 }, eohours{ 0 }, eomins{ 0 }, emo{ 0 }, eiap{ 'n' }, eoap{ 'n' }, enotes{ &quot;&quot; }
  {
  
  }
  
  void _input::get_input() // to store in iss
  {
      cout &lt;&lt; &quot;Enter the entry : Format (Date - In Time - Out Time - Money Owed - Notes)&quot; &lt;&lt; endl;
      getline(cin, user_input);
      iss{user_input};  //THIS IS WHERE I GET THE ERROR
  }
  
  void _input::process_data()
  {
      iss &gt;&gt; eday &gt;&gt; emonth &gt;&gt; eihours &gt;&gt; eimins &gt;&gt; eiap &gt;&gt; eohours &gt;&gt; eomins &gt;&gt; eoap &gt;&gt; emo &gt;&gt; enotes;
      ++esno;
      
  }
  </code></pre>