title: Change color of cout text C++
body: <p>Im trying to change the color of some of my cout outputs but after that cout to be again the same color.</p>
  
  <p>Ive tried the following code:</p>
  
  <pre><code>SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
          cout &lt;&lt; "Help-Please" &lt;&lt; endl;
  </code></pre>
  
  <p>but it continues even after the cout has been completed. Also to add that some of these color changes will be inside if statements. What code would you recommend me to add to to get this effect?</p>