Thread: fstream question!

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    1

    fstream question!

    What's wrong on this code? My printer is don't printing enything?

    #include <iostream>
    #include <fstream>
    using namespace std;

    int main()
    {
    int som = 0, getal, hoeveel;
    char welk;

    cout << "How many cipher
    you want count?" << endl;
    cin >> hoeveel;

    for( int i = 1; i <= hoeveel; i++ )
    {
    cout << "Typ the " << i << "e getal in!" << endl;
    cin >> getal;

    som += getal;
    }
    cout << "Print you result or view it in this window? p = printen b = bekijken" << endl;
    cin >> welk;

    if( welk == 'p' )
    {
    ofstream prout ("LPT1");

    prout << "You result: " << som;
    prout << endl << '\f';
    cin.get();
    }
    if( welk == 'b' )
    {
    cout << "The result " << som;
    cin.get();
    }
    cin.get();
    return 0;
    }

    Sry, for my very bad engelish...

    Greetz
    Petros

  2. #2

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  3. FStream Question
    By CPP-Null in forum C++ Programming
    Replies: 5
    Last Post: 05-25-2003, 01:28 PM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  5. Problems with fstreams.
    By mosdef in forum C++ Programming
    Replies: 7
    Last Post: 06-19-2002, 03:36 PM