Question: Can anyone help me solve this error im getting? I have pasted my code below Student.cpp #include Student.h #include string #include using namespace std; Student::Student(string
Can anyone help me solve this error im getting? I have pasted my code below
Student.cpp
#include "Student.h" #include "string" #include
Student::Student(string id){ studentId = id; }
void Student::addAddress(string sn, int hn, string an, string ct, string st, string cou){
address = Address(sn, hn, an, ct, st, cou);
}
void Student::display() { cout Main.cpp
#include "Student.h" #include
int main(){
Student rishi("rsaripa"); rishi.email = "rishi.saripalle@ilstu.edu"; rishi.name = "Rishi Saripalle"; rishi.grade = "9";
rishi.addAddress("Street Name",123,"Apartment Name","City","State","Country"); rishi.display();
return 0;
}
Student.h
#include
public: string email; string name; string grade;
Student(string id);
void addAddress(string sn, int hn, string an, string ct,string st, string cou); void display();
};
Main.cpp: In function 'int main()': Main.cpp:7:3: error: 'Student' was not declared in this scope Student rishi("rsaripa"); A Main.cpp: 8:3: error: 'rishi' was not declared in this scope rishi.email = "rishi.saripalle@ilstu.edu
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
