Created
October 18, 2021 23:38
-
-
Save mostsignificant/6ef439cdd7698a244119760637adc6be to your computer and use it in GitHub Desktop.
blog-file-name-loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (const auto &file_name : program_options::input_files()) { | |
std::ifstream input_file(file_name, std::ios::in); | |
// ... | |
while (std::getline(input_file, line)) { | |
if (program_options::show_line_numbers()) | |
std::cout << std::setw(6) << std::setfill(' ') << line_count++ << " "; | |
// ... | |
if (program_options::show_ends()) | |
std::cout << '$'; | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment