Re: [Dev-C++] Invalid type argument of 'unary *'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Per W. <pw...@ia...> - 2004-05-30 10:42:46
|
Note that gsbegin and gsend are _references_ to integers, not pointers, so the for loop shouldn't use any star for pointer indirection. /Per W On Sun, 30 May 2004, Kenneth P. Ruppel wrote: > 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); > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |