By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,515 Members | 1,848 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,515 IT Pros & Developers. It's quick & easy.

c++ library for windows

P: n/a
I am writing a program with several cout statements that take up more
than the entire screen.

What commands/libraries should I #include so that the scroll bar
enables me to scroll up to the beginning lines?

Thank you,

Paul Epstein

Nov 5 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
pa**********@att.net wrote:
I am writing a program with several cout statements that take up more
than the entire screen.

What commands/libraries should I #include so that the scroll bar
enables me to scroll up to the beginning lines?

Thank you,

Paul Epstein


There are no standard C++ libraries to do that. You have to use a
library that is specific to the platform you are programming on. There
is also no guarantee that library will be compatible with 'cout' so you
might have a lot of reprogramming to do.

For instance on Unix or Linux you could use the ncurses library, on
Windows you would use the Console functions in the Win32 API.

john
Nov 5 '05 #2

P: n/a

pa**********@att.net wrote:
I am writing a program with several cout statements that take up more
than the entire screen.

What commands/libraries should I #include so that the scroll bar
enables me to scroll up to the beginning lines?


Often command line tools don't care about that because there are more
and less utilities the user uses to pipe the output to.

$ my_program | less

Nov 5 '05 #3

P: n/a
ben
pa**********@att.net wrote:
I am writing a program with several cout statements that take up more
than the entire screen.

What commands/libraries should I #include so that the scroll bar
enables me to scroll up to the beginning lines?

Thank you,

Paul Epstein


A more pragmatic way is to display a screen of info, ask for user to hit
enter before feeding the next page.

ben
Nov 5 '05 #4

P: n/a
Ken
Since you are using windows I will presume that the program is showing
up in a terminal window.

If this is the case then change the default size of the terminal window
so when it opens it will have a scroll bar.

Do the following:
Start Button -> run
type cmd.
click on the little 'c:\' on the upper left corner.
On the screen that opens click on the Layout tab. My settings are:
Screen Buffer Size:
Width: 350
Height: 300
Window Size:
Width: 80
Height: 25

When you close the window say you want to have this apply to the
windows with the same title. If this does not work when you run your
program check to see if the title is the same if not just do the steps
again and when it runs it will be fine.

Or you could pipe it to a file like someone suggested and read it there.

Nov 5 '05 #5

P: n/a
Ken
PS: to pipe in DOS terminal...
name_of_program > name_of_text_file

Example:
dir > out.txt
REM then to read it...
edit out.txt

Nov 5 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.