c++ cannot appear in a constant-expression|
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/9432226/how-do-i-select-a-range-of-values-in-a-switch-statement">How do I select a range of values in a switch statement?</a>  </p>
</blockquote>



<p>I've been getting some errors, and I've been searching for some time now, but I have no idea what is the cause of the errors. (I'm quite new to programming.)</p>

<p>Here are the errors I'm getting:</p>

<pre><code>error: 'Essais' cannot appear in a constant-expression| (line 200)
warning: overflow in implicit constant conversion| (line 202)
</code></pre>

<p>I have case and cote:</p>

<pre><code>  char AfficherCote (int Essais)
 {
 char Cote;
 switch (Essais)
  {
(line200)       case Essais&lt;=20:
    {
(line 202)           Cote='Excellent';

        return (Cote);
        break;
    }
    case Essais&lt;=40:
    {
        Cote='Très bon';
        return (Cote);
        break;
    }
    case Essais&lt;=60:
    {
        Cote='Bon';
        return (Cote);
        break;
    }
    case Essais&lt;=80:
    {
        Cote='Moyen';
        return (Cote);
        break;
    }
    case Essais&lt;=100:
    {
        Cote='Muvais';
        return (Cote);
        break;
    }
    case Essais&gt;=100:
    {
        Cote='Très mauvais';
        return (Cote);
    }
  }
}
</code></pre>
