Why doesn't my program accept "quit" when I input it?
#include<iostream>
#include<fstream>
#include<string>
#include <cassert>
using namespace std;
int main()
{
ifstream file;
char filename[20];
char infile[20];
int count=-1;
for(;;)
{
cout<<"Enter the file name that you want to open or write 'quit' to exit: ";
cin>>filename;
if(filename == "quit")
break;
file.open(filename);
assert(file);
while(file)
{
file>>infile;
cout<<infile<<" ";
count++;
}
file.clear();
file.close();
cout<<endl<<"Words: "<<count<<endl;;
count=-1;
}
system ("PAUSE");
}