143. Write a program to define the member function outside the class?

#include<iostream.h> #include<conio.h> class demo { private:                 int x;                 float y; public:                 void read()                                 {                                 cout<<"Enter Value for X : ";                                 cin>>x;                                 cout<<"Enter Value for Y : ";                                 cin>>y;                                 }                 void display();    //Declaration of Member Function }; void demo::display()      //Definition Outside The Class {                 cout<<"\nX... Continue Reading →

Advertisements

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: