Why is my while loop triggering all the time no matter what I input? : <p>I'm a beginner and I'm trying to do an assignment using a while loop in order to count how many tickets come through a gate and how log what color ticket it is. I thought I coded it correctly but then I got runtime errors and tried to single each mistake out and then 1 by 1 get it to work but I can't even get my while loop to not just trigger on anything the user puts in. Any help would be appreciated, I'm totally lost and I'm aware that this is very beginner. </p>

<pre><code> #include &lt;iostream&gt;

using namespace std;

int main()
{


char answer;


cout &lt;&lt; "start counting tickets? (y/n)" &lt;&lt; endl;
cin &gt;&gt; answer;

while (answer = 'y')
{
    cout &lt;&lt; "ok" &lt;&lt; endl; 
    cin &gt;&gt; answer;
}



return 0;
}
</code></pre>
