title: Cin.getline() function in if statement
body: <pre><code>while (true)
  {
      cout &lt;&lt; "Please enter a  some text: ";
      cin.getline( sendbuf, 100, '\n' );
      i = i + 1;
      if (? = "q") // here i am looking for something that if i press q i should come out of look
      {
          break;
      }
  }
  </code></pre>
  
  <p>I am a beginner and eager to learn more. I want to ask if I can provide some way to terminate this loop by typing char 'q' after typing my all desire strings data.</p>
  
  <p><strong>EDIT</strong> my sendbuf is char* sendbuf, so I don't think so using std::string will help me.</p>