Several Weeks ago I asked a question about testing for the end of an input file.
I have been using this method pretty well for inputting information from an external file. I am using C++.
Expand|Select|Wrap|Line Numbers
- char line[50];
- while(file>>line){
When I try
Expand|Select|Wrap|Line Numbers
- string line;
- while(getline(file, line)){
If there is 0 or 1 white line at the end, I have no problems; however when I have 2 or more empty lines I run into trouble and my program crashes.
Could you please explain what is going wrong? What am I missing?
Thanks You