C++ how do i convert string to char
<pre><code>int main
{
  string data;
  data = "q";

  char myChoice;

  myChoice = data.c_str();
}
</code></pre>

<p>I tried using <code>c_str()</code>, but it doesn't work. How do I convert <code>string</code> to <code>char</code>?</p>

<p><strong>Or rather I would like to ask</strong></p>

<pre><code>int main()
{
  char myInput;
  // How to check user input is either a , b or c for char.
  cout &lt;&lt; "Your Input ";
  cin &gt;&gt; myInput;
}
</code></pre>

<p>For <code>string</code> I can use <code>getline(cin,mystringvariable)</code>, then I check my stringvariable with an if-else statement.</p>

<p>But what about char?</p>
