Thread: dos output screen

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    72

    dos output screen

    at school, Borland C++ v. 4.5 opens an output screen which will not accept the code:

    Code:
    textattr(14);
    what could i do with version 4.5 to get the color to show up on the output screen and what library is needed to use the command.

    Thanx for any comments and help that you all wish to give to me

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    Code:
    #include <conio.h> // for 'textattr'
    #include <cstdlib>
    
    int main(void)
    {
       int i;
    
       clrscr();
       for (i=0; i<9; i++)
       {
           textattr(i + ((i+1) << 4));
           cprintf("This is a test\r\n");
       }
    
       std::system("PAUSE");
       return 0;
    }
    Note that <conio.h> is non-standard, though.

    -Skipper
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Capturing dos text screen in C
    By hednast in forum C Programming
    Replies: 13
    Last Post: 08-11-2005, 07:49 PM
  2. Taking Screenshot - Full Screen Dos
    By loko in forum C Programming
    Replies: 12
    Last Post: 07-16-2005, 01:23 AM
  3. Flash display in DOS screen
    By lordkrishna in forum C++ Programming
    Replies: 9
    Last Post: 02-23-2004, 03:10 AM
  4. DOS screen output 'containment'
    By Unimatrix139 in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 12-19-2002, 04:08 AM
  5. Output to screen display issues
    By spazjr01 in forum C++ Programming
    Replies: 3
    Last Post: 12-16-2002, 05:45 PM