Thank you Daved, again my textbook is wrong. It shows to swap you would do array[i].swap(array[j]).
Type: Posts; User: Wink-
Thank you Daved, again my textbook is wrong. It shows to swap you would do array[i].swap(array[j]).
I have some parallel vectors that need to be sorted. With my knowledge I set them up to be sorted such as this:
void sortInventory(vector<int>& itemID, vector<string>& itemName, vector<int>&...
Thank you Daved. I'll only need one bottle of "Just for Men" to put back the color in my hair I lost from this function. I really appreciate it.
If I pass my parameters as references I get linking errors.
void readData(ifstream& inp, vector<int>& itemID, vector<string>& itemName, vector<int>& pOrdered, vector<double>& manufPrice,...
Thanks hk_mp5kpdw for the help with the referencing and cleaned up loop.
readData(infile, vector<int> itemID, vector<string> itemName, vector<int> pOrdered, vector<double> manufPrice,...
Thanks to Daved's advice, I fixed my function to work properly. Now my problem is calling the function.
void readData(ifstream& inp, vector<int> itemID, vector<string> itemName, vector<int>...
Thank you Daved. You're a life saver. I was incorrectly passing my vectors. I wish my books would have had some examples of them but the chapters on vectors are very short.
Thanks again.
Rob
Thanks for the input Daved and hk_mp5kpdw I really appreciate it.
Daved wrote:
"If you don't know the size before you start reading in the data (which happens a lot), then just read into...
I have a data file that can be of any size and the entries look like this:
integerID
stringName
integerNum doubleVal1 doubleVal2
There can be any number of the blocks of data above that need...