I'm reading Mike McGrath's book on C++. This page I'm on is suppose to read an inut file and count the iterations, but it goes 0 and 1. This book isn't the best but I don't want to skip the page I'd like to know what's gone wrong. Here is the full code.
Thanks, I've moved reader.close(); to the bottom but it still has the same issue. I can move it to the next } but it doesn't do the same in the book.
It's suppose to display the input file and the iterations under it cleanly. Sorry for my noobness.
EDIT: Fixed it by moving
cout << "Iterations: " << i << endl;
reader.close();
To the line 26 and it's done it right, this book is so vague or maybe I'm slow. Thanks helios! Always good to ask for help instead of giving up. :)