fstream question!

This is a discussion on fstream question! within the C++ Programming forums, part of the General Programming Boards category; What's wrong on this code? My printer is don't printing enything? #include <iostream> #include <fstream> using namespace std; int main() ...

  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
    Registered User Daniel's Avatar
    Join Date
    Jan 2003
    Posts
    47

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, 01:14 PM
  2. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  3. FStream Question
    By CPP-Null in forum C++ Programming
    Replies: 5
    Last Post: 05-25-2003, 02: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, 04:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21