Learning C++, I got an operator function in a class but don't know how to call it:
class Getbytes { public: Getbytes(); int operator() (unsigned char* C1, unsigned char* C2) {do something to C1 and C2 and return int; }; } main () { Getbyes myBytes; //Here, how to call the "operator() (unsigned char* C1, unsigned char*C2)"? myBytes?? }
mainis lacking a return type.mainmust be declared with a return type and the return type must beint. You are also missing a semicolon after the closing}of the class definition. On the other hand the semicolon doesn't belong after a function definition. So the;after the closing}of theoperator()overload does not belong there.