Monday 22 March 2010

Fw: ASSIGNMENT

# include <iostream.h>
# include <stdio.h>
# include <conio.h>
static int count=1,id=1;
class a
{
public:
int c,i;
a();
void dl();
};
a *p1,*p2,*p3;//pointers used to keep the address of the recent 3 objects
void main()
{
clrscr();
a ob1,ob2,ob3,ob4,ob5,ob6,ob7;
getch();
}
void a::dl()
{
p2->c=1;
p3->c=2;
cout<<"\ndeleted object"<<p1->i;//i is used to keep the track of the object
delete p1;
count--;
p1=p2;
p2=p3;
}
void a::a()
{
c=count;
i=id;
if(c==1)
p1=this;
else if(c==2)
p2=this;
else if(c==3)
p3=this;
count++;
id++;
if(count==4)
{
dl();
}
}


----- Forwarded Message ----
From: charu <c_charu88@rediffmail.com>
To: Garima.satsangi@yahoo.com
Sent: Mon, 22 March, 2010 3:48:25 AM
Subject: ASSIGNMENT




The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.

No comments:

Post a Comment