title: A way to not accept float as input c++
body: <p>I'm working on a project where I need to check for the correct input (n), I currently have a bit of code which won't allow string to be entered as it will ask again for a correct amount. I'm having trouble writing a code that won't allow float numbers to get through as it currently just ignores the float part of the input. I'm sorry if this is a simple question, but I haven't found a way to get around this yet.</p>
  
  <pre><code>  for(int i=0; i&lt;1; ++i)
      {
          string b1;
          int e;
          do
          {
              getline(cin,b1);
              e=atoi(b1.c_str());
          }
          while(e==0 &amp;&amp; b1!="0");
          n=e; // where n is the user input
      }
  </code></pre>