title: How to pass object to function in c++?
body: <p>Can anyone tell me how I can pass an object to a C++ function?</p>
  
  <p>Any better solution than mine?</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  class abc
  {
        int a;
        public:
               void input(int a1)
               {
                    a=a1;
               }
               int display()
               {
                    return(a);
               }   
  };
  
  void show(abc S)
  {
      cout&lt;&lt;S.display();
  }
  
  int main()
  {
      abc a;
      a.input(10);
      show(a);
      system("pause");
      return 0;
  }
  </code></pre>