#include <cstring> using namespace std; class Student {private: char _name[20]; char _no[20]; int _score; public: Student(int score){_score = score;} bool operator>(Student s); }; bool Student::operator>(Student s, Student b) { return s._score > b._score; }; int main() { Student a(70); Student b(75); cout<<(b>a)<<endl; }
I just started on C++ and have a problem with simple codes. The error then says that 'bool Student::operator>(Student, Student)' must take exactly one argument.