#include using namespace std; class WebPage; class ItLinks { private: int IndexTerm; // Web page id WebPage* wplink; // Pointer to web page public: void SetItl(int j) {IndexTerm=j;} int GetItl() {return IndexTerm;} }; class WebPage { private: int wpnumber; // Web page id WebPage* nextwp; // Pointer to web page ItLinks itl[3]; //Index terms Links public: void SetItl(int i,int j) { this->itl[i].SetItl(j);} int GetItl(int i) { return this->itl[i].GetItl();} }; class WebList { private: WebPage* first; // Pointer to first web page in list int number; // Total number of web pages in list public: }; class IndexTerm { private: int itnumber; //Index term id int numberoftimes; //# of web pages that include itnumber WebPage* link2webpage; //Pointer to web page IndexTerm* nextit; //Pointer to index term public: }; class ITList { private: IndexTerm* first; // Pointer to index term in list int number; // Total number of (different) index terms public: }; // The following function takes as input a pointer to the first element // in the web pages list and an integer m and returns a pointer to the // instance of struct webpage that represent web page m, or NULL (zero) // if the web page is not in the list. int main(void) { int m,i1,i2; char t; WebPage w; w.SetItl(0,3); w.SetItl(1,5); w.SetItl(2,7); cout << w.GetItl(0) << " " << w.GetItl(1) << " " << w.GetItl(2) << endl; }