Calculator - C++ operator-overloading
You can also overload operator&gt;&gt; instead of using getdata():

std::istream&amp; operator&gt;&gt;(std::istream&amp; in, calculator&amp; obj)
{
    return in &gt;&gt; obj.val;
}


Similar approach with showdata(), using operator&lt;&lt;:

std::ostream&amp; operator&lt;&lt;(std::ostream&amp; out, calculator const&amp; obj)
{
    return out &lt;&lt; "value: " &lt;&lt; obj.val;
}


As for your existing overloads, you shouldn't need to return a calculator.  You appear to treat each calculator object as a single value.  This makes each one to appear to be single-use, and the more values you wish to enter, the more objects thus the more code you'll need to have.

What you should do is maintain one object and have val maintained as you enter data.  However, this will also mean that your arithmetic operators aren't needed.  If you wish to keep them, then you'll have to approach this differently.  For instance, you can calculate (not merely input) a final value for different calculators and use those operators to get a new value.  This may look like a needless approach for a simple calculator, but at least you're still able to utilize these arithmetic operators.

Some miscellaneous notes:


Be aware of the issues of using using namespace std.
You don't appear to be using &lt;conio.h&gt;, so just remove it.
You don't need to use std::endl in so many places.  A simple "\n" for outputting a newline should be sufficient.  More info about that here.