Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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