Read data from text file and store in doubly linked list
struct node{
int num;
node*next=NULL;
node*prev=NULL;
};node*head=NULL;
node*temp=NULL;
void start()
{ int num;
bool flag=false;
ifstream myfile("file.txt");
while(!myfile.eof())
{
myfile>>num;
node*c=new node;
c->num=
if(head==NULL)
{
head=c;
flag=true;
}
else
{
temp=head;
{
while(temp->next!=NULL)
{
temp=temp->next;
}
temp->next=c;
c->prev=temp;
}
}
}
myfile.close();
}
int num;
node*next=NULL;
node*prev=NULL;
};node*head=NULL;
node*temp=NULL;
void start()
{ int num;
bool flag=false;
ifstream myfile("file.txt");
while(!myfile.eof())
{
myfile>>num;
node*c=new node;
c->num=
if(head==NULL)
{
head=c;
flag=true;
}
else
{
temp=head;
{
while(temp->next!=NULL)
{
temp=temp->next;
}
temp->next=c;
c->prev=temp;
}
}
}
myfile.close();
}
If you're looking to lose fat then you absolutely have to jump on this totally brand new custom keto meal plan diet.
ReplyDeleteTo create this keto diet, licenced nutritionists, fitness trainers, and professional chefs have joined together to provide keto meal plans that are effective, decent, price-efficient, and delightful.
From their launch in early 2019, thousands of people have already remodeled their body and health with the benefits a smart keto meal plan diet can provide.
Speaking of benefits: clicking this link, you'll discover eight scientifically-confirmed ones given by the keto meal plan diet.