Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- class Int {
- public:
- Int() : m_a(0) { }
- Int(int a) : m_a(a) { }
- void Subtract(const Int& f) { m_a -= f.m_a; }
- Int Subtract(const Int& f) const { return Int(f.m_a); }
- int a() const { return m_a; }
- private:
- int m_a;
- };
- Int myfunc() {
- Int first(6);
- Int second(2);
- return first.Subtract(second);
- }
- int main()
- {
- Int f = myfunc();
- printf("%d\n", f.a());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement