So I'm supposed to copy the word "computer" or "computers" from the text of one file and past the word each time to the new file. It compiles but it doesnt run right. Any input would be great.
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
char filename, filename2, word[20]; //char to read the input and output files as well as word from the file
ofstream fout;//output file
ifstream fin;//input file
cout << "Enter you input file:";
cin>>filename;//stores the input filename
fin.open("filename");//open input file
cout << "Enter your output filename";
cin>>filename2;//stores output filename
do
{
if(strcmp("COMPUTER", word) || strcmp ("COMPUTERS", word))//looks for both computer and computers in file
{
fout.open ("filename2");//open output file
fout<<word;//prints the word in the output file
}
}while(word);
fin.close();//closes input file
fout.close();//closes output file
return 0;
}