1.

What is the correct function prototype of () operator overloading?(a) return_type operator(arguments)();(b) return_type operator(arguments);(c) return_type operator()(arguments);(d) return_type operator(Class_name)(arguments);I have been asked this question in quiz.I need to ask this question from Functors topic in chapter Algorithms, Objects & Iterators in C++ of C++

Answer»

Right option is (C) return_type operator()(arguments);

The explanation: The CORRECT SYNTAX of OVERLOADING a () operator in a class is as follows:

return_type operator()(arguments){}



Discussion

No Comment Found

Related InterviewSolutions