i have a file i am reading from, however it only prints part of the code and it appears to be a buffer problem. can anyone help?
Code:
#include <iostream>
#include <windows.h>
#include <fstream.h>
#include <conio.h>
#include <stdlib.h>
int numchoice;
void main()
{
char ch;
cout << "Welcome to the Airport Flight Database" << endl;
cout << " " << endl;
cout << "1 - Display all Flight information" << endl;
cout << "2 - Display details for Flight number________ " << endl;
cout << "3 - Find Flight(s) for a set route" << endl;
cout << "4 - " << endl;
cin >> numchoice;
ifstream file;
file.open("flight.txt",ios::nocreate);
if(!file)
{
cout<<"UNABLE TO OPEN FILE!!";
goto end;
}
while(file)
{
file.get(ch);
cout<<ch;
}
getch();
end:
file.close();
system("cls");
}