title: Error: C++ requires a type specifier for all declarations
body: <p>I'm new to C++ and I've been reading this book. I read a few chapters and I thought of my own idea. I tried compiling the code below and I got the following error: </p>
  
  <blockquote>
    <p>||=== Build: Debug in Password (compiler: GNU GCC Compiler) ===|
    /Users/Administrator/Desktop/AppCreations/C++/Password/Password/main.cpp|5|error:
    C++ requires a type specifier for all declarations| ||=== Build
    failed: 1 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|.</p>
  </blockquote>
  
  <p>I don't understand what is wrong about the code, might anyone explain what's wrong and how to fix it? I read the other posts but I was unable to understand it.</p>
  
  <p>Thanks.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  main()
  {
      string password;
      cin &gt;&gt; password;
      if (password == "Lieutenant") {
          cout &lt;&lt; "Correct!" &lt;&lt; endl;
      } else {
          cout &lt;&lt; "Wrong!" &lt;&lt; endl;
      }
  
  }
  </code></pre>