title: Calling a function of a class in the main
body: <p>I know we can call a function of a class in the main by the of an object  e.g</p>
  
  <pre><code> object.Function1(object);
  </code></pre>
  
  <p>But is there any way of calling the function like the following</p>
  
  <pre><code>  Function1(object);
  </code></pre>
  
  <p>I had to write a class which would run the code with a main function as follows     </p>
  
  <pre><code>  int main() {
    Line line1(10);
    Line line2 = line1; 
    display(line1);
    display(line2);
    return 0;
     }
  </code></pre>