A1 - { cin>>a; } void c2::input() { cin>>b; }...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> # class c2; class c1 { int a; public: void get(); void out() { cout<<"Class 1 :"<<a<<endl; } friend void ex(c1 &,c2 &); }; } class c2 { int b; public: void input(); void output() { cout<<"Class 2 :"<<b<<endl; } friend void ex(c1 &,c2 &); }; } void c1::get()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { cin>>a; } void c2::input() { cin>>b; } void ex(c1 &a1, c2 &a2) { int t; t=a1.a; a1.a=a2.b; a2.b=t; } void main() { clrscr(); c1 a1; c2 x1; a1.get(); a1.out(); x1.input(); x1.output(); ex(a1,x1); a1.out(); x1.output(); getch(); }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Spring '06 term at University of Mumbai.

Page1 / 2

A1 - { cin>>a; } void c2::input() { cin>>b; }...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online