FRIENDFN - } void x::input() {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> # class x; class a { int c; public: void get(); friend void add(a,x); }; } class x { int b; public: void input(); friend void add (a,x); }; } void a::get() { cin>>c;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } void x::input() { cin&gt;&gt;b; } void add (a p, x q) { float r; r=(p.c + q.b)/2; cout&lt;&lt;r; } void main() { a a1; x x1; a1.get(); x1.input(); add(a1,x1); }...
View Full Document

Ask a homework question - tutors are online