title: How to apply validation on a string variable so that it accept only alphabetic data from the user?
body: <p>I want to make the user enter alphabetic data only not any numeric or special character data. So how do I apply the validation? For example, in the following code, I want the user to input name and name doesn't include any number or special character. I want to make it accept only alphabetic data.</p>
  
  <pre><code>int main()
  {
     string str;
     cout&lt;&lt;"Enter your name: ";
     cin&gt;&gt;str;
  }
  </code></pre>