Semester.h
-------
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include "Subject.h"
using namespace std;
class User;
class Subject;
class Semester
{
public:
Semester( std::string, int , std::string, int);
~Semester ();
std::string getsemesterName() const;
void loadSubjects();
void addSubject(std::string, std::string);
vector <Subject *> theSubjects;
private:
std::string semesterName;
bool currentSemester;
int year;
std::string season;
};
-------
Subject.h
#include <iostream>
#include <fstream>
#include <string>
#include "SubjectData.h"
class Semester;
class SubjectData;
class Subject
{
public:
Subject ();
Subject(std::string, std::string);
~Subject ();
std::string getSubjectName() const;
std::string getCourseId() const;
void setSubjectName(std::string name);
void setCourseId(std::string id);
void downloadSubjectData();
void loadSubjectData();
SubjectData theSubjectData[7];
private:
std::string subjectName;
int subjectNumber;
std::string courseId;
bool monitor;
};
"Dave" <be***********@yahoo.com> wrote in news:vqreah8lln8n31
@news.supernews.com:
"ree" <re*@hotmail.coom> wrote in message
news:Xn****************************@211.29.133.50. .. I am actually passing one of the semesters to a particular function.
---
Semester * newSemester = new Semester(name, intYear, season,rSem);
semesters.push_back(newSemester);
HtmlWriter HtmlSemesterPage;
HtmlSemesterPage.htmlSemesterPage(*newSemester);
---
In that function i am trying to read the courseId string from the
first subject in the semester.
void HtmlWriter::htmlSemesterPage(Semester theSemester)
{
std::string subjectId = theSemester.theSubjects[0].getCourseId();
but I keep getting this error...
error C2228: left of '.getCourseId' must have class/struct/union
type
Could you please show your class definitions for Semester and Subject?
Thanks!