Sunday, 27 November 2011

C++ Program For Use Friend Function In Variable Swapping


#include<iostream.h>
#include<conio.h>
class second
class first
 {
  int a;
  public;
  void getdata(int x)
   {
    a=x;
   }
   friend void check(first,second);
 };
 class second
  {
   int b;
   public:
   void get data(int n)
    {
 b=x;
}
friend void check(first,second);
 };
 void main()
  {
   first ob;
   second ob1;
   getch();
  }

No comments:

Post a Comment