If people following this video want to keep adding your code examples to the same source file, they will need to close the file after each read (for example) so that things will work out correctly. If you want to keep these examples in the same source file for future reference, you'll need to close the file after each read so that the new example will work as shown in the video.
Thanks again for the effort to make these videos! Great reviews of basic C++ concepts.
Please make more! I love this material and do put them all in one file unless it is a complete example like the time class.
stokescomp 2 weeks ago
If you forget to call .close() it will get called in the destructor so no big deal.
Peterolen 3 months ago
To avoid outputting garbage at the end it is better to avoid checking against .eof()
char c;while (infile.get(c)){cout << c;}
Peterolen 3 months ago
Nice video...
If people following this video want to keep adding your code examples to the same source file, they will need to close the file after each read (for example) so that things will work out correctly. If you want to keep these examples in the same source file for future reference, you'll need to close the file after each read so that the new example will work as shown in the video.
Thanks again for the effort to make these videos! Great reviews of basic C++ concepts.
tcbetka 3 months ago
so smart and well made!
twirlspin123 3 months ago