title: Changing specific character's color in c++ console
body: <p>I'm making a calendar program for my c++ class and I was just wondering if there was a way to change color of certain days in the program (for example, christmas, new years, weekends, would all be different colors) if it is not possible can i at least bold or something...</p>
  
  <p>here is my code </p>
  
  <pre><code>char *month_name[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
  char *month_underline[12] = {"-------", "--------", "-----", "-----", "---", "----", "----", "------", "---------", "-------", "--------", "--------"};
  char *week_name[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
  int days = 1;
  int days_max;
  int i, j, k;
  
  for(i = 0; i &lt; 12; i++)
  {
      cout &lt;&lt; "--------------------------------------------------------------------------------";
  
      cout &lt;&lt; '\n' &lt;&lt; month_name[i] &lt;&lt; '\n';
      cout &lt;&lt; month_underline[i] &lt;&lt; "\n\n";
  
      for (j = 0; j &lt; 7; j++)
      {
          cout &lt;&lt; week_name[j] &lt;&lt; "     ";
      }
  
  
  
      cout &lt;&lt; "\n\n";
  
      if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) //i is the number of the month minus 1 (jan = 0, feb = 1, etc.)
          days_max = 32;
      else if (i == 3 || i == 5 || i == 8 || i == 10)
          days_max = 31;
      else if (i == 1)
          days_max = 29;
  
      for (days = 1; days &lt; days_max; days++)
      {
          if (i == 0 || i == 9)
          {
              if (days == 1)
              {
                  cout &lt;&lt; "                        ";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else if (days == 6 || days == 13 || days == 20 || days == 27)
              {    
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
  
          if (i == 1 || i == 2 || i == 10)
          {
              if (days == 1)
              {
                  cout &lt;&lt; "                                                            ";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }                
              else if (days == 3 || days == 10 || days == 17 || days == 24 || days == 31)
              {
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
          if (i == 3 || i == 6)
          {
              if (days == 1)
              {
                  cout &lt;&lt; "            ";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }                
              else if (days == 7 || days == 14 || days == 21 || days == 28)
              {
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
          if (i == 4)
          {
              if (days == 1)
              {
                  cout &lt;&lt; "                                    ";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }                
              else if (days == 5 || days == 12 || days == 19 || days == 26)
              {
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
          if (i == 5)
          {
              if (days == 1)
              {
                  cout &lt;&lt; "                                                                        ";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }                
              else if (days == 2 || days == 9 || days == 16 || days == 23 || days == 30)
              {
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
          if (i == 7)
          {
              if (days == 1)
              {
                  cout &lt;&lt; "                                                ";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }                
              else if (days == 4 || days == 11 || days == 18 || days == 25)
              {
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
          if (i == 8 || i == 11)
          {           
              if (days == 8 || days == 15 || days == 22 || days == 29)
              {
                  cout &lt;&lt; "\n\n";
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
              }
              else 
                  cout &lt;&lt; setw(4) &lt;&lt; days &lt;&lt; "        ";
          }
  
  
      }
          cout &lt;&lt; "\n";
  }
  
  cout &lt;&lt; "--------------------------------------------------------------------------------";
  
  
  system("PAUSE");
  return EXIT_SUCCESS;
  }
  </code></pre>