title: In C++ how can I input a string into a char array of struct?
body: <p>I'm a beginner student in computer science and I faced a problem which I couldn't find the solution for it anywhere. 
  When I tried to input a string using <code>cin.get();</code> </p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  int SIZE = 0;
  
  struct Books {
      float isbn;
      string author;
      string Bname;
  };
  
  void funAddb(Books book[], int);
  
  int main()
  {
  
      int choose;
      Books book[SIZE];
      int n;
      do {
          cout &lt;&lt; " WELCOME \n ENTER (2) to return a borrowed book:";
          cin &gt;&gt; choose;
          switch (choose) {
          case 2:
              funAddb(book, SIZE);
              break;
          }
          cout &lt;&lt; endl
               &lt;&lt; "If you want to stop please enter (0):" &lt;&lt; endl;
          cin &gt;&gt; n;
      } while (n != 0);
      return 0;
  }
  
  void funAddb(Books b[], int SIZE)
  {
      cout &lt;&lt; endl
           &lt;&lt; "Please enter the book name:" &lt;&lt; endl;
      cin.ignore(100, '\n');
      getline(cin, b[SIZE].Bname);
      cout &lt;&lt; endl
           &lt;&lt; "Please enter the ISBN:" &lt;&lt; endl;
      cin &gt;&gt; b[SIZE].isbn;
      cout &lt;&lt; endl
           &lt;&lt; "Please enter the author name:" &lt;&lt; endl;
      cin.ignore(100, '\n');
      getline(cin, b[SIZE].author);
      SIZE++;
  }
  </code></pre>
  
  <p>The size should be changeable not fixed, the solution that i found suggested that i change the size of the array to 100 but i don't know whats the purpose of that</p>