Can anyone help me in this code? I am trying to read data from file into a linked list . My linked list is something like this:
The data in the file are in the format like this:
####****### **####*****#
and so on
node *copy = new node();
rownum=1;
seatnum=1;
while(!fin.eof())
{
fin>>copy->data;
cout<<copy->data;
copy->next=NULL;
if(head==NULL)
{
copy->next=head;
head=copy;
}
cout<<"Row number-" <<copy->row<<" "<<copy->data;
copy->row=rownum;
copy->seat=seatnum;
seatnum=seatnum+1;
if (seatnum==total)// total is total number of seats in a row
{
seatnum=1;
rownum=rownum+1;
}
}