stu nicholls dot com | menu - Professional dropdown #3

Example
#include < iostream.h >
#include < conio.h >
class test{
      int i,j,k,sum;
      public:
      void add(int a, int b, int c=77)
	     {
	     i=a;
	     j=b;
	     k=c;
	     sum=i+j+k;
	     cout <<  "\n\n Sum is : " << sum;
	     }
      };
      void main()
      {
      test t1,t2;
      clrscr();
      cout << "\n\n Example for Default arguments";
      t1.add(22,33,44);
      t2.add(58,56);
      getch();
}
GO BACK
Footer1