title: compiler not recognizing methods defined outside the class declaration
body: <p>new to c++.Im stuck with a question here, i made a bank account program which has functions like withdraw() and deposit() defined in a class called 'account'.So, i defined my class in a different file(account.h) also i defined withdraw() inside the class itself but defined the deposit() function outside the class in 'account.cpp' file.When i compile it i get  the following error -
  <code>undefined reference to 'account::deposit(int)'</code>
  I'm not an expert but i think it doesn't recognize that i defined the define() function int account.cpp.Also i use vscode (idk if that helps).</p>
  
  <p>here is the code-
  main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include "account.h"
  
  int main()
  {
      account Ajay_bank;
  
      if (Ajay_bank.withdraw(1000))
      {
          std::cout &lt;&lt; "withdraw successful\n";
  
      }
      else
      {
          std::cout &lt;&lt; "withdraw failed";
      }
  
      if (Ajay_bank.deposit(2000))
          std::cout &lt;&lt; "Deposit successful";
      else
          std::cout &lt;&lt; "[error - NET404]:try again later";
  
  
  }
  </code></pre>
  
  <p>account.cpp-</p>
  
  <pre><code>#include "account.h"
  
  
  bool account::deposit (int amount)
  {
      balance += amount;
      return true;
  }
  </code></pre>
  
  <p>account.h-</p>
  
  <pre><code>#ifndef _ACCOUNT_H
  #define _ACCOUNT_H
  
  #include &lt;string&gt;
  
  class account
  {
  private:
      std::string name;
      int balance {200};
      int credit_score {};
  public:
      bool withdraw (int amount)
      {
          if (balance - amount &gt;= 0)
          {
              balance -= amount;
              return true;
          }
  
          else
              return false;
  
      }
      bool deposit (int amount);
  
  };
  
  #endif
  </code></pre>
  
  <p>Thanks.</p>