Read all the lines C++
Go to solution
Solved by CookieMaster,
Figured it out
{ ifstream File((filename + type).c_str()); // Load file and file type stated above. while (getline(File, img)) cout << img << endl; // Display the image. system("pause"); // Don't exit application //Todo: add array. }
26 minutes ago, TheKDub said:I'm not familiar enough with C++ file handling to be able to help much there, though the basic idea of it would just be something like a while loop checking to see if there's another line in the file to be read, then reading that line within the loop.
Thanks again. While was just needed and then got rid of closing the file.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now