Thread: How to change the text using Dev-CPP. Not a question just trying to help

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    178

    How to change the text using Dev-CPP. Not a question just trying to help

    I've noticed that a lot of people, especially newbies have had trouble with this issue, I am one of them. After searching for over an hour, I finally figured out how to do it using dev -cpp

    [ code ]

    #include <conio.c> //needed to change the text color
    #include <iostream.h> //needed for cout / cin

    int main()
    {
    textcolor(COLOR); //where color can be RED, BLUE , etc.
    //it seems that the color needs to be in all caps
    system("cls"); //not the best way, but it clears the screen

    cout<<"This is colored text. ";

    system("pause"); //once again not the best, but it pauses
    //the screen

    return 0;
    }
    [/code]

    hopefully this helps.

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    178
    sorry dorked up the code tags

    Code:
      
    
    #include <conio.c> //needed to change the text color 
    #include <iostream.h> //needed for cout / cin 
    
    int main() 
    { 
    textcolor(COLOR); //where color can be RED, BLUE , etc. 
    //it seems that the color needs to be in all caps 
    system("cls"); //not the best way, but it clears the screen 
    
    cout<<"This is colored text. "; 
    
    system("pause"); //once again not the best, but it pauses 
    //the screen 
    
    return 0; 
    }

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    need to include stdlib.h

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    >> #include <conio.c>
    This is bad practice, instead of including it, you should add it to your project in Dev-C++
    "There are three kinds of people in the world...
    Those that can count and those that can't."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Easily change text color
    By d00b in forum C++ Programming
    Replies: 10
    Last Post: 07-24-2005, 05:24 PM
  2. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 04:49 PM
  3. Lamo question... About linux & cpp :\
    By Pandora in forum Linux Programming
    Replies: 2
    Last Post: 03-17-2003, 04:57 PM
  4. To change text colour
    By Dirty Harry in forum C Programming
    Replies: 2
    Last Post: 06-16-2002, 03:04 AM
  5. How do you change the color of the text?
    By NewbieVB in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2002, 02:25 PM