All pastes #198720 Raw Edit

Untitled

public text v1 · immutable
#198720 ·published 2006-10-12 04:04 UTC
rendered paste body
int main ()
{
        char current;
        string filename;
        int totalchar=0;
        ifstream in_stream

        cout << "Please enter the filename: ";
        cin >> filename;

        instream.open(filename);

        if(in_stream.fail())
        {
                cout << "Failed to open input file.\n"
        }
        else
        {
                do
                {
                        cin.get(current);
                        cout.put(current);
                        totalchar++;
                } while (!cin.eof());
        }
        cout << totalchar << " characters processed.\n";
        return 0;
}