Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Please help to Solve the Error Code

cry8383cry8383 SingaporePosts: 1

I'm beginner of c++, no knowledge on c++. I'm writing a code for student and module. The requirement is need to displayed the module and the student with final score, also the duplication. When I write the case 5 and case 6, after compile it show the error below.

Requirement 3 – design and modelling of all related classes (5%)
Requirement 4 – Attendance percentage and the final score (5%)
Requirement 5 – Identification and the removal of duplicate records (5%)
Requirement 6 – bottom x% of the students’ records in a module (5%)
Requirement 7 – top 5% of all students of all modules (5%)

Requirement3 and 4 already solved.

I'm stuck in requirement 5 and 6.

melpon.org/wandbox/permlink/qLnE80Hs6FJWl9Fy

Appreciate who can help me to solved.

Error below.
error C2664: 'int std::basic_string<_Elem,_Traits,_Ax>::compare(const std::basic_string<_Elem,_Traits,_Ax> &) const' : cannot convert parameter 1 from 'std::string (__cdecl *)(void)' to 'const std::basic_string<_Elem,_Traits,_Ax> &'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits,
1> _Ax=std::allocator
1> ]
1> Reason: cannot convert from 'std::string (__cdecl *)(void)' to 'const std::basic_string<_Elem,_Traits,_Ax>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits,
1> _Ax=std::allocator
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous

error C3867: 'std::basic_string<_Elem,_Traits,_Ax>::compare': function call missing argument list; use '&std::basic_string<_Elem,_Traits,_Ax>::compare' to create a pointer to member
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits,
1> _Ax=std::allocator
1> ]
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion)
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception(470): could be 'bool std::operator ==(const std::_Exception_ptr &,const std::_Exception_ptr &)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception(475): or 'bool std::operator ==(std::_Null_type,const std::_Exception_ptr &)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception(481): or 'bool std::operator ==(const std::_Exception_ptr &,std::_Null_type)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(408): or 'bool std::operator ==(const std::error_code &,const std::error_condition &)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(416): or 'bool std::operator ==(const std::error_condition &,const std::error_code &)'
1> while trying to match the argument list '(std::string, int)'

Tagged:
Sign In or Register to comment.