C++
Member Function
Declaring Member Functions Outside the Class
#include<iostream.h>
#include<conio.h>
class demo
{
int a;
float b; //data members
public: // access specifiers
void input(); //memeber functions
void show(); //member functions
};
void demo :: input()
{
cout<<"Enter the values :";
cin>>a>>b;
}
void demo :: show()
{
cout<<"The first Value : "<<a<<endl;
cout<<"The Second Value : "<<b;
}
void main()
{
clrscr();
demo d;
d.input();
d.show();
getch();
}

Post a Comment
0 Comments