Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

problem with ofstream to printer


  • Please log in to reply

#1
tom_pauwaert

tom_pauwaert

    Member

  • Member
  • PipPip
  • 12 posts
Hi

My printer is connected to my USB001 port, and in my c++ book that i bought i learned some command to send the eum output to your printer...

here's the program

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

main()
{
	ofstream prout ("USB001");
	for (  char ch = 'a'; ch <= 'z';  ch++)
	prout << ch;

	prout << '\f';
	cin.get();
}


so the output should be that my printer starts printing the line

abcdefghijklmnopqrstuvwxyz

but it doesn't do that... instead it makes a file (in the same map the program is in) named USB001
that when you open it using some text program you get the output in... namely the line of above...


any help would be really appreciated
(im using Borland C++ 6 enterprise environment or whatever it's called :tazz:)
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP