making object from Address and trying to refer to it is not working
Student::Student(string studentInfo_c){ // student constructor
stringstream ss(studentInfo_c);
getline(ss, lastName, ',');
getline(ss, firstName, ',');
getline(ss, address1, ',');
getline(ss, address2, ',');
getline(ss, city, ',');
getline(ss, state, ',');
getline(ss, zipCode, ',');
Address sAddrs(address1, address2, city, state, zipCode);
}
ostream& operator<<(ostream& os, const Student& s){ os << s.lastName << ", " << s.firstName << " " << s.aAddrs;
return os; // first place that sAddrs oject is referenced
}
class prototypes:
class Student {
private:
string line;
string lastName;
string firstName;
string address1;
string address2;
string city;
string state;
string zipCode;
public:
//Student() : Address aAddrs this didnt work...
Student(string studentInfo_c);
string get_firstName();
string get_lastName();
void set_address(string address1_f, string address2_f, string city_f, string state_f, string zipCode_f);
friend ostream& operator<<(ostream& os, const Student& s);
~Student();
}
error: In function 'std::ostream& operator<<(std::ostream&, const Student&)':| C:\Users\Chris\Documents\Summer 2017 Semesters\HeapOStudents\student.cpp|67|error: 'const class Student' has no member named 'aAddrs'|
C:\Users\Chris\Documents\Summer 2017 Semesters\df\student.cpp|73|error: 'aAddrs' was not declared in this scope|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
p.s. I know this is similar to other questions but none of them have seemed to work for me, they are slightly more advanced.
thanks,