@ultrilliam
Ya this is probably much more ideal, lol
So where did I lose you in DM's?
hold on... let me see if I'm as lost as I think I am...
sooooo.... I'm getting an error in the files that were given to us...
What's the error?
And changing that to DoctorList.h?
DoctorList.h:19:12: error: 'Doctor' does not name a type static Doctor doctors[]; ^~~~~~
it seems like all of the files have the #include "Doctor.h" though
Had a feeling we would hit a brick wall there lol
Hm
so am I supposed to create another file named Doctor.h?
Hm, yea, throw this in Doctor.h ```cpp /* * File : DoctorList.h * Author: Ricky Landry (rlandry) * Course: COP3014 * Proj : Project 02 * Descr : The declaration of the class that contains the initialized list * of doctors available to be scheduled for the day. * */ #ifndef DOCTORLIST_H_ #define DOCTORLIST_H_ #include "Doctor.h" class DoctorList { public: static Doctor doctors[]; static const int size; }; #endif /* DOCTORLIST_H_ */ /* * File : DoctorList.cpp * Author: Ricky Landry (rlandry) * Course: COP3014 * Proj : Project 02 * Descr : The definition of the class that contains the initialized list * of doctors available to be scheduled for the day. */ #include "DoctorList.h" Doctor DoctorList::doctors[] = { {"Gerardo Socia", 45, "Ophthalmology"}, {"Jeremy Porche", 31, "Neurology"}, {"Tamiko Poat", 57, "Pediatrics"}, {"Marjorie Weatherman", 27, "Rheumatology"}, {"Cheyenne Stevenson", 35, "Cardiology"} }; const int DoctorList::size = sizeof(doctors)/sizeof(Doctor); ```
make all of that Doctor.h
?
Wait back that up
Let's go back a bit to this, what file does this come from (the error)
DoctorList.cpp
no, PatientList.cpp
it says DoctorList.cpp on the pic, but now that file is giving different errors...
OOOOHHHHH, that's from DoctorList.h
giving the same exact error for all 4 files
all saying there's no Doctor.h
Okay, Let's just create a blank Doctor.h then and see what happens
new errors!
yay
LOL
Now let's create patient.h
did that
```cpp typedef string Doctor; typedef string Patient; ```
where do I put those?
At the top of the Doctor/Patient files
(lists)
in the cpp or h files? or both?
`typedef string Patient;` in the patient files `typedef string Doctor;` in the doctor files
Probably only the CPP is needed, since it would already be there once the .h files are included
The first error in both cpp files is coming from the .h files
I is back
Whew, that's earlier then expected lol
I said 2 hours... it's been just over 2 hours lol
Oh, I read 5 hours
still getting this: ``` DoctorList.cpp:9:9: error: 'string' does not name a type typedef string Doctor; ^~~~~~
```cpp typedef char Doctor; typedef char Patient; ``` v2?
okay, now only this: ``` DoctorList.cpp:17:77: error: braces around scalar initializer for type 'Doctor {aka char}' {"Cheyenne Stevenson", 35, "Cardiology"} }; ^
and for PatientList.cpp: ``` In file included from PatientList.cpp:10:0: PatientList.h:19:12: error: 'Patient' does not name a type static Patient patients[]; ^~~~~~~ PatientList.cpp:13:31: error: 'Patient PatientList::patients []' is not a static data member of 'class PatientList' Patient PatientList::patients[] = { {"Alan Harry", 24, "Male"}, ^ PatientList.cpp:60:76: error: braces around scalar initializer for type 'Patient {aka char}' {"Mazie Harry", 70, "Other"} }; ^ PatientList.cpp:62:38: error: 'patients' was not declared in this scope const int PatientList::size = sizeof(patients)/sizeof(Patient); ^~~~~~~~
this is very frustrating...
Hm
Join our real-time social learning platform and learn together with your friends!