title: C++ C4244 =': conversion from 'std::streamsize' to 'unsigned short', possible loss of data; any solution?
body: <p>I'm fairly new to C++ and I just got done learning about Classes. I don't know why I keep getting this error C4244(check title).
  I'm using Visual Studio 2017
  Feedback would be appreciated.</p>
  
  <p>//my program askes users to enter a sentence 
      `</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std
  Const short MAX = 132;
  
  class information
  {
  char sentence[MAX];
  short gcount;
  public:
      unsigned short CharCount;
      void InputData();
      void showresult();
  };
  Int main()
  {
      Information data;
      data.InputData();
      data.showresult();
      return 0;
  }
  
  void information::InputData()//member function to enter info
  {
      cin.ignore(10, '\n');
      cout &lt;&lt; "Enter your sentence " &lt;&lt; endl;
      cout &lt;&lt; endl;
      cin.getline(sentence, sizeof(sentence));
      CharCount = cin.gcount(); // this is the problem
  
  }
  
  void information::showresult() //show number of characters
  {
      cout &lt;&lt; " Characters in the sentence:: " &lt;&lt; CharCount  &lt;&lt; endl; 
      system(“Pause”);
  }
  </code></pre>
  
  <p>`</p>