Skip to content

Instantly share code, notes, and snippets.

@insaneyilin
Created March 16, 2021 05:57
Show Gist options
  • Save insaneyilin/f125410531ea02813218cf53a2351942 to your computer and use it in GitHub Desktop.
Save insaneyilin/f125410531ea02813218cf53a2351942 to your computer and use it in GitHub Desktop.
generate filename list with leading zeros
#include <iostream>
#include <sstream>
#include <iomanip>
int main() {
for (int i = 0; i < 10; ++i) {
std::stringstream ss;
ss << std::setfill('0') << std::setw(8) << std::fixed << i << ".txt";
std::cout << ss.str() << std::endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment