Showing posts with label friend. Show all posts
Showing posts with label friend. Show all posts

Thursday, September 13, 2012

Friend Function Implementation in C++ Programming

Friend Function Implementation in C++ Programming

Questions:-
Create two classes DM and DB which store the value of distances. DM stores
distances in meters and centimeters and DB in feet and inches. Write a program
that can read values for the class objects and add one object of DM with another
object of DB. Use a friend function to carry out the addition operation. The object
that stores the results may be a DM or DB object, depending on the units in
which the results are required.
(Object Oriented Programming With C++ By Balaguruswamy)