constructor - Getting an error message in C++ -
I'm new to C ++ (I'm a C programmer), so I apologize if this is a silent question seems to be. / P>
When I run this program, I get the following error message:
Error C2661: 'Student: Student': No overloaded function takes 2 arguments
I commented where the error occurs (2 examples). Thank you
// "student.h" Student included: Student (string intimate, double init GPA) // here error and main.cpp {name = initName; GPA = initGPA; } String student: getName () {return name; } Double student :: getGPA () {return GPA; } Zero Student :: PrintInfo () {cout & lt; & Lt; Name & lt; & Lt; "There is a student with GPA:" & lt; & Lt; GPA & lt; & Lt; Endl; } //student.h #include & lt; String & gt; # Include & lt; Iostream & gt; using namespace std; Class students {Private: string name; Double GPA; Public: string getName (); Double getGPA (); Zero set GPA (double GPA); Zero printInfo (); }; //main.cpp # include & lt; Iostream & gt; #include "Student.h" int main () (Student ("Lumuil", 3.2); // Here the error is cut & lt; & Lt; S.getName () & lt; & Lt; Endl; Cout & lt; & Lt; S.getGPA () & lt; & Lt; Endl; Cout & lt; & Lt; "GPA is changing ..." & lt; & Lt; Endl; S.setGPA (3.6); S.printInfo (); Return 0; }
Your constructor has not been declared.
Try it:
Comments
Post a Comment