title: How to change text color and console color in code::blocks?
body: <p>I am writing a program in C. I want to change the text color and background color in the console. My sample program is - </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;dos.h&gt;
  #include &lt;dir.h&gt;
  
  int main(int argc,char *argv[])
  {
   textcolor(25);
   printf("\n \n \t This is dummy program for text color ");
   getch();
  
   return 0;
  }
  </code></pre>
  
  <p>When I compile this program code::blocks gives me an error - textcolor not defined. Why is this so? I work in a GNU GCC compiler and Windows Vista. If it is not going to work what is the duplicate of textcolor. Like that I want to change the background color of the console. The compiler gives me the same error just the name of the function is different. How to change the color of the console and text. Please help.</p>
  
  <p>I am okay even if the answer is in C++.</p>