overloading >> in class with instream : <p>i have the following code:</p>

<pre><code>class someclass
{
     private :
     unsinged char a; 
     public :
      ...
}
</code></pre>

<p>I want to use </p>

<pre><code>std::istream&amp; operator&gt;&gt;(std::istream &amp;in,  someclass &amp;x)
{
    in&gt;&gt;x.a;
    return in;
}

int main()
{
  someclass test;
 std::cin&gt;&gt;test;
 return 0;
}
</code></pre>

<p>My problem is that, as a user, I want to insert an integer between 0-255. However, it only accepts single chars. How am I supposed to "cast" it to integers only?</p>

<p>Thank you.</p>

<p>Greetings.</p>
