title: What is Object Scope in Oop?
body: <p>Hi I read this definition on internet..</p>
  
  <blockquote>
    <p>A destructor is a special member function of a class that is executed
    whenever an object of it's class goes out of scope or whenever the
    delete expression is applied to a pointer to the object of that class.</p>
  </blockquote>
  
  <p>I tried this code..</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  class Name{
      public:
          void Fun(){
              cout &lt;&lt; "Function" &lt;&lt; endl;
          }
          Name(){
              cout &lt;&lt; "Constructor" &lt;&lt; endl;
          }
          ~Name(){
              cout &lt;&lt; "Destructor" &lt;&lt; endl;
          }
  };
  int main(){
      Name obj;
      obj.Fun();
      cout &lt;&lt; "End" &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>It's calling destructor at the end of program..!! Mean object scope is the end of program? Sorry I'm little confused...</p>