Sunday, 27 November 2011

C++ Program For Object Passing


#include<iostream.h>
#include<conio.h>
class test
 {
  int a;
  float b;
  public:
  void read()
   {
     cout<<"Enter the value of a and b";
cin>>a>>b;
   }
  void put()
   {
     cout<<"value of a="<<a<<endl<<"value of b="<<b;
   }
  };
  void main()
   {
    test ob;
ob->put();
getch();
   }

No comments:

Post a Comment