Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (mandre):

I am writing a program to cycle through my logfiles to determine if the build was successful. Currently I have to write the below block for each logfile: ``` fstream logfile ("C://Development/Java/build_scripts/logs/admin.log", ios::in); while (getline(logfile, line)) { if (line.find("BUILD SUCCESSFUL") < line.length()) cout << "Successful" << endl; } logfile.close(); ``` Surely there must be a way to use a loop to cycle through each file in the folder? I'm using Codeblocks and this is a console program.

OpenStudy (mandre):

Thanks.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!