// A sample program to illustrate basic string operations. v. 4/12/06 // - Example using exchange sort as function #include #include #include using namespace std; // Give prototype of sort function void SortStrings( string X[], int Size ); int main() { string Names[100]; // Assume no more than 100 names in file fstream Infile; int InCt = 0, i; Infile.open( "names.txt", ios::in ); // Read the file while( Infile >> Names[ InCt ] ) InCt++; // It would be safer code if we checked to make sure InCt < 100! // Print the array (so we can see what's there) cout << "Original list" << endl; for ( i=0; i