coloured text in console

Discussion in 'C++' started by Ghai, Apr 19, 2006.

  1. Ghai

    Ghai Guest

    i need help in displaying coloured text in console.
    got any other way exept accessing text area in oxB8000
    please help.
    Ghai, Apr 19, 2006
    #1
    1. Advertising

  2. Ghai wrote:
    > i need help in displaying coloured text in console.


    Then you need to post to the newsgroup dedicated to your OS. C++ has
    no built-in means defined to do what you want.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Apr 19, 2006
    #2
    1. Advertising

  3. Ghai

    Rolf Magnus Guest

    Ghai wrote:

    > i need help in displaying coloured text in console.


    Standard C++ doesn't even have a "console". So you need some non-standard
    library that does it for you. One such library that is available for many
    systems is called 'ncurses'.
    Rolf Magnus, Apr 19, 2006
    #3
  4. Ghai

    asterisc Guest

    There is also: CONIO (console input output), known for Borland3.1
    (16bit DOS c/c++ programming)
    asterisc, Apr 19, 2006
    #4
  5. * Ghai:
    > i need help in displaying coloured text in console.
    > got any other way exept accessing text area in oxB8000
    > please help.


    Be aware that the C++ standard library offers only basic i/o facilities
    such as pure text streams. So your question is technically off-topic
    here. But you couldn't know that before asking... ;-)

    One answer is given by the FAQ "How can I change the colors on the
    screen", currently at <url:
    http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.21>.

    However, while following that advice will teach you things you really
    need to know, in the long run, it doesn't help you directly here & now.

    You forgot to mention your system, but it's obviously (for those
    familiar with it) Microsoft Windows.

    Both *nix and Windows have standard libraries that do colored text i/o.
    In *nix I believe ncurses can do this feat (at least it allows you to
    move the cursor around, clear the screen, and so on), and in Windows you
    can use the Windows console API functions. In both cases it amounts to
    using a library, and if you need help with that, please ask in an
    appropriate system-specific group (see this group's FAQ for guidelines).

    If you're lucky your compiler may provide some simpler interface to the
    relevant library.

    In that case it may be enough simply to include the relevant header
    shipped with your compiler: for that you need to check your compiler's
    documentation, as the FAQ item mentioned above advices.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, Apr 19, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    353
  2. Venkat

    Coloured Buttons

    Venkat, Jun 30, 2003, in forum: HTML
    Replies:
    3
    Views:
    2,727
    Steve Pugh
    Jul 1, 2003
  3. sudip

    coloured text...

    sudip, Jul 1, 2005, in forum: C Programming
    Replies:
    4
    Views:
    392
    Dik T. Winter
    Jul 7, 2005
  4. Tomás Ó hÉilidhe

    Cross-platform: Coloured text, Networking, Multithreading

    Tomás Ó hÉilidhe, Nov 12, 2008, in forum: C Programming
    Replies:
    34
    Views:
    931
    CBFalconer
    Nov 14, 2008
  5. Jonathan Hartley

    cross-platform coloured text in terminal

    Jonathan Hartley, Apr 16, 2010, in forum: Python
    Replies:
    4
    Views:
    352
    Jonathan Hartley
    Apr 20, 2010
Loading...

Share This Page