title: What does the error ``expected ";" before obj'' mean?
body: <p>I am writing a program in C++ using my own header file.</p>
  
  <p>main.cpp</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include"operation.h"
  
  using namespace std;
  main()
  {
    int a;
    cout &lt;&lt;"Enter the value a";
    cin&gt;&gt;a;
  
    //class name add
    //obj is object of add
    add obj;
    obj.fun(a);
  }
  </code></pre>
  
  <p>operation.h</p>
  
  <pre><code>class add
  {
  
    void  fun(int b)
    {
      int c,d=10;
      c=d+b;
      cout&lt;&lt;"d="&lt;&lt;d;
    }
  }
  </code></pre>
  
  <p>When I compile using G++ in Linux, it is showing the following errors:</p>
  
  <pre><code>-&gt;expected ";" before obj
  -&gt;obj not declared in this scope 
  </code></pre>
  
  <p>How do I solve this problem? Why is this happening?</p>