.
Home About-us Privacy Policy Contact-us Services

Thursday, October 8, 2015

C++ Program to concept of destructor

ad+1

Program -

#include<iostream.h>
#include<conio.h>
class abc
{
private:
int rn;
float fee;
public:
abc()
{
rn=20;
fee=286;
}
void dispdata()
{
cout<<"\n rollno is"<<rn;
cout<<"\n fee is"<<fee;
}
~abc()
{
cout<<"destructor invoked";
}
};
void main()
{
clrscr();
class abc a;
a.dispdata();
getch();
}

Output - 

 Roll no is 20
 fee is 286

 


0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates