#include<iostream.h>
#include<conio.h>
class test
{
public:
int data1;
char data2;
test()
{
cout<<"contrsuctor";
data1=1;
data2='a';
}
~test()
{
cout<<"destrucor";
}
void show()
{
cout<<"data1"<<data1;
cout<<"data2"<<data2;
}
};
void main()
{
test *ptr;
test object1;
ptr = &object1;
cout<<"\npointer\n";
ptr->show();
delete ptr;
getch();
}
rahulvramesh 0 Newbie Poster
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
Cross213 -5 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.