Clear my queue before i read data into it from a file?
It will read in the data correctly except i have an extra bit off info which im sure is there because i havnt cleared the queue first.
Heres my code:
case 'R' : cout << " read in data saved to file \n";
Plane_save = fopen("PlaneOrd.txt","rb"
fread(&airplane, sizeof(char),1,Plane_save);
addPlane(q, letter);
while(!feof(Plane_save))
{
addPlane(q,airplane);
fread(&airplane,sizeof(char),1,Plane_save);
}
fclose(Plane_save);
break;
It will read in the data correctly except i have an extra bit off info which im sure is there because i havnt cleared the queue first.
Heres my code:
case 'R' : cout << " read in data saved to file \n";
Plane_save = fopen("PlaneOrd.txt","rb"
fread(&airplane, sizeof(char),1,Plane_save);
addPlane(q, letter);
while(!feof(Plane_save))
{
addPlane(q,airplane);
fread(&airplane,sizeof(char),1,Plane_save);
}
fclose(Plane_save);
break;