s C++ function, Reads the file and creates a new file
 
solution of question 9
[SET – 1]

A C++ function, that reads the file FIRST.TXT and creates a new file named SECOND.TXT, to contain only those words from the file FIRST.TXT which start with a lowercase vowel

 

void vowelwords()
{
	ifstream fin;
	fin.open("FIRST.TXT");
	ofstream fout;
	fout.open("SECOND.TXT");
	char word[30];
	while(!fin.eof())
	{
		fin>>word;
		if(word[0]=='a'||word[0]=='e'||word[0]=='i'||word[0]=='o'||word[0]=='u')
			fout<<word<<" ";
	}
	fin.close();
	fout.close();
}