I cannot get my code to compile because it keeps telling me "error: no matching function for call" on line 16. Any advice? I am suppose to read the file and write all the vowels to an output file.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
string filename; // to hold the file name
ifstream inputfile; // input to a file
// Get the file name
cout << "Enter a file name: ";
cin >> filename;
// Open the file
inputfile.open(filename); // LINE 16
char vowel; // to store the vowels
ofstream outputfile; // to write to the file
// open file
outputfile.open("vowels_.txt");
while(inputfile.get(vowel)){
//If the char is a vowel or newline, write to output file.
if((vowel == 'a')||(vowel == 'A')||(vowel =='e')||(vowel =='E')||(vowel =='i')||(vowel =='I')||(vowel =='o')||(vowel =='O')||(vowel =='u')||(vowel =='U')||(vowel =='\n') && !inputfile.eof())
outputfile.put(vowel);
}
inputfile.close();
outputfile.close();
}