Print a file to Printer in DEV-C++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 31
Reputation: CRD is an unknown quantity at this point 
Solved Threads: 0
CRD CRD is offline Offline
Light Poster

Print a file to Printer in DEV-C++

 
0
  #1
Apr 12th, 2007
I am trying to write a program to print a file to a printer.

havent gotten fery far till I started to go ary, here is the listing so far.

  1.  
  2. // This Program is to print a file listing with line numbers to Printer.
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <conio.h>
  6. int line = 0, page = 0;
  7.  
  8. int main( int argv, char *argc[] )
  9. {
  10. char buffer[256];
  11. FILE *fp;
  12. printf("Enter File Name.\n ");
  13.  
  14. scanf("filename.ext" );
  15.  
  16. printf("%d",filename.ext "\n" );
  17.  
  18. system( "PAUSE" );
  19.  
  20. return 0;
  21. }

I'm thinking that the SCANF is not capturing the filename.ext thier for

ofcourse it will not print is the following statement.

any assistance would be greatly Appreciated.

Thank you

Dick
Last edited by WaltP; Apr 13th, 2007 at 1:21 am. Reason: Fixed CODE tags -- nice try but no cigar! See that PREVIEW button? It helps
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Print a file to Printer in DEV-C++

 
0
  #2
Apr 13th, 2007
> scanf("filename.ext" );
What is this line supposed to do?
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 31
Reputation: CRD is an unknown quantity at this point 
Solved Threads: 0
CRD CRD is offline Offline
Light Poster

Re: Print a file to Printer in DEV-C++

 
0
  #3
Apr 13th, 2007
it is to capture input of a filename & extention
from the keyboard.

Dick
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Print a file to Printer in DEV-C++

 
0
  #4
Apr 13th, 2007
And how does scanf know where to put this captured data?
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Print a file to Printer in DEV-C++

 
0
  #5
Apr 13th, 2007
When was the last time you looked at the format of a scanf() command? And while you're at it, read this about scanf()
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC