I've got the ints and floats working fine but the words ain't going so well. I am getting an error message that reads " error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
Here's the code for the words I am trying to sort:
Expand|Select|Wrap|Line Numbers
- //string array declaration
- filein.open("QUOTES.DAT"); //open string filein
- string sArray[100]; //declare string array
- int NumS = 89; //variable for size of string array
- for(int k = 0; k < NumS; k++) //load string array
- filein>>sArray[k];
- cout<<"\n\nThe original word values:\n";
- display(sArray, NumS);
- sort(sArray, NumS);
- cout<<"\n\nThe sorted word values:\n";
- display(sArray, NumS);
- cout<<endl<<endl;
- filein.close();
- filein.clear();
I can supply more code if need be.
Thanks