Thank you all for your help. I made a few changes on my code and I am getting fewer errors, but still many.
I've been thinking about what you explained TheIdeasMan.
I've been working on it for a "few hours". :-|
I am under some restrictions:
data members must be private
member functions must be ppublic
use the set member function
use the get member function (which I forgot to do)
validate the data (which I haven't added yet)
so, am I using a constructor when I am not supposed to or don't need to? is it a "one or the other" thing but not both?
I had orginally tried s.set... instead of &Student, but I received an errror message indicating I should use &Student.
Also, in this piece of code, I get an error saying "no instance of overloaded function "Student::Student" matches the specified type"
1 2 3 4
|
//implementation
Student::Student() {
}
Student::Student(string m_FirstName, string m_LastName, string m_City, string m_State, string m_Telephone, string m_Year, int m_Enrolled, int m_Completed)
| |
Other errors below:
1>------ Build started: Project: Lab8, Configuration: Debug Win32 ------
1> Lab8.cpp
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(35): error C2084: function 'Student::Student(void)' already has a body
1> c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(20) : see previous definition of '{ctor}'
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(38): error C2511: 'Student::Student(std::string,std::string,std::string,std::string,std::string,std::string,int,int)' : overloaded member function not found in 'Student'
1> c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(6) : see declaration of 'Student'
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(96): error C2264: 'Student::Student' : error in function definition or declaration; function not called
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(98): error C3867: 'Student::setFirstName': function call missing argument list; use '&Student::setFirstName' to create a pointer to member
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(100): error C3867: 'Student::setLastName': function call missing argument list; use '&Student::setLastName' to create a pointer to member
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(102): error C3867: 'Student::setCity': function call missing argument list; use '&Student::setCity' to create a pointer to member
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(104): error C3867: 'Student::setState': function call missing argument list; use '&Student::setState' to create a pointer to member
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(106): error C3867: 'Student::setEnrolled': function call missing argument list; use '&Student::setEnrolled' to create a pointer to member
1>c:\users\fgower\documents\visual studio 2010\projects\lab8\lab8\lab8.cpp(108): error C3867: 'Student::setCompleted': function call missing argument list; use '&Student::setCompleted' to create a pointer to member
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
I'll post my modified code in the next post since I know I'll run out of room here.
Again, any help is greatly appreciated.