All pastes #567350 Raw Edit

Stuff

public cpp v1 · immutable
·published 2007-06-14 23:22 UTC
rendered paste body
int cprogram::cpAddPath(){       char yesNo = ' ';    cout << "What is the start location?" << endl;    cin.get(cpFromLocation, 100, '\n');    while(cin.get() != '\n');    cout << "What is the end location?" << endl;    cin.get(cpToLocation, 100, '\n');    while(cin.get() != '\n');    cout << "Is this a direct connection? (Y or N)" << endl;    cin >> yesNo;    while(cin.get() != '\n');    while(yesNo != 'y' && yesNo != 'n')    {        cout << "Please enter (Y or N)" << endl;        cin >> yesNo;        while(cin.get() != '\n');    }        if(yesNo == 'y')    {        g.adtInsert(cpFromLocation, cpToLocation, cpIntermittent);    }        else    {        yesNo = ' ';        int i = 0;        while(yesNo != 'y')        {            cout << "Please enter the intermittent destinations" << endl;            cin.get(cpTemp, 100, '\n');            while(cin.get() != '\n');            strcpy(cpIntermittent[i], cpTemp);            cout << "Is " << cpIntermittent[i] << " all of the intermittent destinations?" << endl;            cin >> yesNo;            while(cin.get() != '\n');                        while(yesNo != 'y' && yesNo != 'n')            {                cout << "Please enter (Y or N)" << endl;                cin >> yesNo;                while(cin.get() != '\n');            }        }        g.adtInsert(cpFromLocation, cpToLocation, cpIntermittent);    }        }------------------------------------------------------------struct node {    struct node * next; //->next    char * description; //description about the activity    char * otherpeople; //other people who will join in the activity    char * activitydate; //activity date    char * key; //Hash Key};/*Table ADT*/class table{    public:        table() { table(1009); }; //If no size is defined, use default key        table(unsigned int hashsize); //Allow for passed size        ~table(); //Destructor                int adtRemove(const char * cpKey, const char * cpDescription,const char * cpOtherPeople, const char * cpActivityDate); //ADT removal        int adtRetrieve(const char * cpKey, const char * cpDescription,const char * cpOtherPeople, const char * cpActivityDate, char ** returnedList); //ADT retrieve (but NOT display)        private:        struct node **adtHashTable; //Hash table array        struct node * current; //Current location of linked list        struct node * temp; //Temp holder for linked list        unsigned int hashsize; //Hash size};