[Dev-C++] Invalid type argument of 'unary *'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Kenneth P. R. <kpr...@op...> - 2004-05-30 09:34:49
|
I'm getting error message "invalid type argument of 'unary *'" on the stmt indicated, and I just don't see why. Couldja help? I've clipped out what pertains to these variables. TIA. Ken // Functions void Day1Hit(int &d1, string &day2, vector<string> &mtglist, int &gsbegin, int &gsend) { cout << "Now in Day1Hit..." << endl; for (int i= *gsbegin; i < *gsend; i++) { ERROR IS FOR THIS STMT if (*mtglist[i].substr(0,3) == *day2.substr(((*d1+1)*3)-3,3)) { cout << "Day1Hit: matched on " << (mtglist[i].substr(0,3) << endl; cout << *Day2.substr(((*d1+1)*3)-3,3)) << endl; } // end if } // end for return;} // end Day1Hit vector<string> Mtglist; // Input - loaded from a disk file vector<int> Groupset; // subscripts/pointers to Groupset ranges {Here, Groupset is created during a first pass through Mtglist. Groupset[n] is the beginning of a range of records in Mtglist to be processed. Groupset[n+1] is the end of that range of records in Mtglist. The last record in any range in Mtglist is called the WDR.} Day1.assign("SMTWTFS"); Day2.assign("SunMonTueWedThuFriSat"); // gs moves thru Groupset[]. for (int gs=0; gs < Groupset.size()-1; gs+=2) { // Process Day1 against the WDR. d1 moves through Day1, looking for a hit. for (int d1=0; d1 < 7; d1++) { // I set the next variables for readability and ease of typing. D1P=Day1.substr(d1,1); WDRP=Mtglist[Groupset[gs+1]].substr(d1+1,1); if (D1P == WDRP) { int gsbegin=Groupset[gs]; // record number of beginning of a group range in Mtglist int gsend=Groupset[gs+1]; // record number of end of that group range in Mtglist Day1Hit(&d1,&Day2,&Mtglist,&gsbegin,&gsend); |