English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

My output is too large ,thats the way its supposed to be.The problem is that half of the output is at the top of the page and I just cant scroll my way up to it.Meaning I cant view the output placed at the top.My teacher asked me to add page break.Don't know how to add it.

2007-04-14 18:20:08 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

If this is Turbo C for DOS, pipe output to a file, then load the file into Notepad and print it with notepad.

To pipe output to a file, use the > sign. For example:

Say your program is foo.exe, type in at DOS prompt

FOO > FOOOUT.TXT

Then load FOOOUT.TXT in notepad and print it there.

2007-04-14 18:26:11 · answer #1 · answered by Kasey C 7 · 0 0

I'm not sure what you mean here. Oh well, I'll tackle both possibilities.....

If you're outputting to the monitor and everything is scrolling too quickly to see the output, you can just add a line of code to add a pause after a certain number of lines has been written to the screen. You need a variable to keep track of how many lines have been outputted and then execute something like this:

/* kbhit() requires the conio.h header file */
while (!kbhit()) /* wait for keypress */

If you're outputting to a printer, you need a variable to keep track of the number of lines outputted, and then print the ASCII character for a page break (12 decimal, or 0c hex), like this:

printf("\x0c");

2007-04-15 01:41:54 · answer #2 · answered by Balk 6 · 0 1

fedest.com, questions and answers