title: 'not declared in this scope' when using strlen()
body: <p>I am trying to compile this piece of code but for whatever reason it won't work. Can someone help me? I want to know how to use strlen() properly:</p>
  
  <pre><code> #include&lt;iostream&gt;
   using namespace std;
  
   int main()
   {
      char buffer[80];
  
      cout &lt;&lt; "Enter a string:";
      cin &gt;&gt; buffer;
      cout &lt;&lt; strlen(buffer);
  
      return 0;
  
   }
  </code></pre>
  
  <p>I've tried using cin.getline(buffer, 80); but I get the same compile error issue. </p>
  
  <p>My compiler says the error is this</p>
  
  <blockquote>
    <p>error: strlen was not declared in this scope</p>
  </blockquote>