• C


if i am using fputchar
how do i send it to the printer?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shorty225Author Commented:
if i am using putchar
how do i get it to print to the printer
Here's the help for putchar

Function: int putchar (int c)

The putchar function is equivalent to putc with stdout as the value of the stream argument.

Here's the help for putc

Function: int putc (int c, FILE *stream)

This is just like fputc, except that most systems implement it as a macro, making it faster.  One consequence is that it may evaluate the stream argument more than once, which is an exception to the general rule for macros.  putc is usually the best function to use for writing a single character.

Thus, I think u should use putc for your task
shorty225Author Commented:
my chararters are coming in from a file
its like 20 lines per page
is there anyway fputchar will print this to the printer
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
under linux, you can print to the /dev/lp0 device
under windows, you can go to lpt1 etc...

under linux you could pipe  your data to lpr/lpd and send your output to a remote printer.

The first do will all use the buffered file I/O family of functions


The other would require pipes and a little more effort
sure it can.


where c is the character to print.
PRN is defined as the printer port
FILE *prn;
char c;

Or on some systems:


Another one:


On my system,all 3 work.

I guess i am too late on this one as well.
sorry,replace putchar with fputc.
yeah, guess the original guy wasn't really that interested...we've all answered these with good answers, but I guess without the original guys response it would be better to split the points since they are all "accurate" but who knows which way the original guy would have wanted since there is more then one way do this operation depending on OS, needs, etc...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.