Output to stdprn Is in Binary (Untranslated) ModeLast reviewed: July 17, 1997Article ID: Q68944 |
6.00 6.00a 6.00ax 7.00 | 6.00 6.00a | 1.00 1.50 1.51 1.52
MS-DOS | OS/2 | WINDOWSkbprg
The information in this article applies to:
SUMMARYThe 16-bit C start-up code automatically opens five files for a program's use. The "stdprn" file (PRN device) is opened in binary mode, which is important to remember when printing to printers that require a carriage return/line feed combination to end a line (for example, some laser printers). In those cases, you do one of the following:
MORE INFORMATIONThe following is a code fragment that illustrates each method:
#include <stdio.h> #include <io.h> #include <fcntl.h> void main(void){ FILE *txtprn; fprintf(stdprn, "untranslated\n"); // Standard mode fprintf(stdprn, "CRLF pair added \n\r"); // Method 1 txtprn=freopen("PRN", "wt",stdprn); // Method 2 fprintf(txtprn, "translated\n"); fflush(stdprn); // Flush the buffer first setmode(fileno(stdprn), O_TEXT); // Method 3 fprintf(stdprn, "translated\n");}
|
Additional reference words: kbinf 5.10 6.00 6.00a 6.00ax 7.00 1.00 1.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |