HELP: Controlling Console Output

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I am a new C++ programmer and am working with the Visual C++ studio.
I am attempting to create a simple console application for myself but I fin
that neither of the introductory C++ books I own tell me how to clear the console
screen or change the font color. Is there some way to do this that could b
understood by a novice programmer?

Here are the three things I would like to do:
[1] Control the size of the console screen when the program is first
executed (it always opens up as a small window but I want it to open t
a full screen.
[2] Clear the scree
[3] Change the font color

I will appreciate any help! Thanks
 
I am a new C++ programmer and am working with the Visual C++ studio.
I am attempting to create a simple console application for myself but I find
that neither of the introductory C++ books I own tell me how to clear the console
screen or change the font color.

They won't tell you because there's no universal way of doing it.

For a MS Windows console application you can use:
Here are the three things I would like to do:
[1] Control the size of the console screen when the program is first
executed (it always opens up as a small window but I want it to open to
a full screen.)

Try SetConsoleScreenBufferSize.
[2] Clear the screen

Have a look at Knowledge Base article 99261 "HOWTO: Performing Clear
Screen (CLS) in a Console Application".
[3] Change the font color

Try SetConsoleTextAttribute.

Dave
 
Back
Top