Colored Text

This is a discussion on Colored Text within the C Programming forums, part of the General Programming Boards category; I am writing a Text-Based Parser Adventure Game in C and had a question. What I want is to display ...

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    5

    Colored Text

    I am writing a Text-Based Parser Adventure Game in C and had a question.

    What I want is to display colored text. All of this will be from the command prompt using printf and whatnot I just want to be able to specify a color that certain text will be displayed in. How would I go about doing that? any help would be greatly appreciated

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Programs for microwaves and toasters can be coded in C. This operation is OS dependant, if it is even supported. Furthermore, this question is asked very frequently, I suggest searching the board before you ask.

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,506
    Which OS / Compiler?

    For reasonably portable coloured text, use the ncurses library.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    5
    Thank you Salem for the help, I'll look up ncurses
    and thank you Tonto for being a douchebag

  5. #5
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

    ╔╗╔╦══╦╗╔╦══╦╗
    ║╚╝║╔╗║╚╝║╔╗║║
    ║╔╗║╠╣║╔╗║╠╣╠╣
    ╚╝╚╩╝╚╩╝╚╩╝╚╩╝

    codez http://code.google.com/p/zxcvbn/

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    5
    problem solved, thank you very much sir

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to use FTP?
    By maxorator in forum C++ Programming
    Replies: 8
    Last Post: 11-04-2005, 02:17 PM
  2. Colored Text in C
    By colorC in forum C Programming
    Replies: 4
    Last Post: 02-23-2004, 03:58 AM
  3. how to cout colored text?
    By Guanhui in forum C++ Programming
    Replies: 1
    Last Post: 07-05-2002, 08:14 AM
  4. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  5. Colored Text
    By Yoshi in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-28-2001, 08:46 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21