title: Using Char in an if statement C++
body: <p>Folks, I'm trying to use an 'if' statement with a char variable, but it doesn't seem to notice when the 'yes' condition is met.  I don't know if there's a way to do this without the array.  Here's my code below.  Any help is much appreciated.  </p>
  
  <pre><code>// Running times calculator
  
  # include &lt;iostream&gt;
  # include &lt;math.h&gt;
  
  using namespace std;
  
  int main ()
  {
      float cTime;
      float gTime;
      float cDist;
      float gDist;
  
      float min;
      float sec;
  
      float cMin;
      float cSec;
      float p1000;
  
      char response[1];
  
      int blank;
  
      printf ("Welcome to the running times calculator.\n\nEnter your completed race distance in metres: \n");
      scanf ("%f", &amp;cDist);
      printf("Enter your completed race time. Type minutes, hit enter. Type seconds, hit enter\n");
      scanf ("%f" "%f", &amp;cMin, &amp;cSec);
  
      cTime = cSec+(60*cMin);
      p1000 = pow(1000/cDist,1.1)*cTime;
  
      printf ("Would you like to enter another race time to improve prediction accuracy? \n");
      scanf ("%s", &amp;response);
  
      if(response == "yes")
      {
         printf ("Enter your completed race distance in metres: \n");
         scanf ("%f", &amp;cDist);          
         printf("Enter your completed race time. Type minutes, hit enter. Type seconds, hit enter\n");
         scanf ("%f" "%f", &amp;cMin, &amp;cSec);
  
         cTime = cSec+(60*cMin);
        p1000 = ((pow(1000/cDist,1.1)*cTime)+p1000)/2;
  
      }
  
      printf ("What is your goal race distance in metres? \n");
      scanf ("%f", &amp;gDist);
  
      gTime = pow(gDist/1000, 1.1)*p1000;
      min = gTime/60;
      sec = remainder(gTime,60);
  
      if (sec &lt; 0)
      {
      sec = sec + 60;
      min = min - 1;    
      }
      printf ("Your predicted time for a race of %.0f metres is %.0f minutes and %.0f seconds", gDist, min, sec);
      scanf("%f", &amp;blank);
  
      return 0;
  }
  </code></pre>