Previous in Forum: Photo Editing   Next in Forum: programming
Close
Close
Close
10 comments
Rate Comments: Nested
Anonymous Poster #1

how to connect printer to the c program output ?

06/29/2011 4:44 AM

i want to print output of c program

Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#1

Re: how to connect printer to the c program output ?

06/29/2011 5:09 AM

Ha! this is the myth of 'high level' languages.
Use the 'printf' function, but of course if you are writing for your own non standard harware you will have to write your own printer driver in a low level language.
Del

__________________
health warning: These posts may contain traces of nut.
Reply
Anonymous Poster #1
#2
In reply to #1

Re: how to connect printer to the c program output ?

06/29/2011 6:04 AM

PRINTF FUNCTION MEANS LIKE HOW ?ANY EXAMPLE.... WHICH OUTPUT IS OBTAINED IN HARDCOPY

Reply
4
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#3
In reply to #2

Re: how to connect printer to the c program output ?

06/29/2011 6:11 AM

main ()
{
printf ("I should use Google or a basic book on C");
}

__________________
health warning: These posts may contain traces of nut.
Reply Good Answer (Score 4)
Guru
Engineering Fields - Optical Engineering - Member Engineering Fields - Engineering Physics - Member Engineering Fields - Systems Engineering - Member

Join Date: Apr 2010
Location: Trantor
Posts: 5363
Good Answers: 647
#4
In reply to #3

Re: how to connect printer to the c program output ?

06/29/2011 7:40 AM
__________________
Whiskey, women -- and astrophysics. Because sometimes a problem can't be solved with just whiskey and women.
Reply
Anonymous Poster #1
#6
In reply to #4

Re: how to connect printer to the c program output ?

06/30/2011 1:23 AM

im using window xp and shared printer .. so i dont know to how to code

Reply
Anonymous Poster #1
#7
In reply to #6

Re: how to connect printer to the c program output ?

06/30/2011 1:37 AM

fprintf(stdprn,"hello");

stdprn = fopen("PRN","wb");
fprintf(stdprn,"From Windows: Test test test\f");
fclose(stdprn);

i used this code

IN my system im using shared printer and port connected is DOT4_001

i didt get any response from printer while compiling

Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#8
In reply to #7

Re: how to connect printer to the c program output ?

06/30/2011 2:36 AM

Sorry can't help, this is way out of my experience. I code small control systems with hardware designed by me. People occasionally say they want our stuff to interface to a laptop.
They don't really need it, and why would I want to design a load of hardware and write code so that Bill Gates can make it obsolete a year down the road?
In the old days you could just output to the printer port or serial of a PC via a quick knife and fork program in QBasic in 5 minutes. They call this progress.
Del

__________________
health warning: These posts may contain traces of nut.
Reply
Anonymous Poster #1
#9
In reply to #8

Re: how to connect printer to the c program output ?

06/30/2011 5:22 AM

hmmm thank u sir

Reply
Guru
Hobbies - DIY Welding - Don't Know What Made The Old Title Attractive... Popular Science - Weaponology - New Member United States - US - Statue of Liberty - 60 Year Member

Join Date: Apr 2009
Location: Yellowstone Valley, in Big Sky Country
Posts: 7425
Good Answers: 295
#5
In reply to #3

Re: how to connect printer to the c program output ?

06/29/2011 8:55 AM

Hyuk yuk yuk!

__________________
Semper Ubi Sub Ubi
Reply
Anonymous Poster #1
#10
In reply to #1

Re: how to connect printer to the c program output ?

07/01/2011 2:17 AM

i got output by coverting output into txt

Reply
Reply to Forum Thread 10 comments

Good Answers:

These comments received enough positive votes to make them "good answers".
Copy to Clipboard

Users who posted comments:

Anonymous Poster (5); Doorman (1); Usbport (1); user-deleted-1105 (3)

Previous in Forum: Photo Editing   Next in Forum: programming

Advertisement