-2

I have a class Bill, and I wrote this functor in this class

//functor 

    bool operator==(const Bill& other) const;

    void operator()(int x) { sumCost -= x; }

What I don't know, is how to use it in main.

Thanks for help!

built1n
  • 1,518
  • 14
  • 25

1 Answers1

3

Use it in the main will be the same as use in any other function:

int main()
{
    Bill b;
    b( 123 );
    return 0;
}
Slava
  • 43,454
  • 1
  • 47
  • 90