while brain's handles errors and such more elegantly, I must say that Hunter2's code is much more straightforward and to the point...
and on the topic of gogator's code, what about this:
Code:
#include <vector>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void makeVector(string line, vector <string> &Adjust);
int main(void){
vector <string> Storage;
string infileName,outfileName, fileLine;
fstream input_file, output_file;
cout << "Enter the filename to read in: ";
cin >> infileName;
input_file.open(infileName.c_str(),ios::in);
cout << endl << "Enter the filename to read out to: ";
cin.ignore(80,'\n');
getline(cin, outfileName);
output_file.open(outfileName.c_str(), ios::out);
if(!input_file.fail()){
while(getline(input_file, fileLine)){
makeVector(fileLine, Storage);
}
for(int i=0; i<Storage.size(); i++) output_file << Storage[i] << endl;
}
return 0;
}
void makeVector(string line, vector <string> &Adjust){
string vowels = "aeiouyAEIOUY", tempLine = line;
for(int i=0; i<line.length(); i++){
for(int j=0; j<vowels.length(); j++){
if(line[i] == vowels[j]){
int line_diff = line.length()-tempLine.length();
Adjust.push_back(line.substr(line_diff,i-line_diff));
tempLine = line.substr(i,line.length());
}
}
}
Adjust.push_back(tempLine);
}
(sorry gogator if you didn't want that reposted - PM me and I'll edit it out)