Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2021 13:47
What would you like to do?
#include <cstdio>
#include <cstdlib>
#include <string>
void save_data(const std::string filename) {
printf("%s\n", filename.c_str());
int main() {
std::string filename;
for (int i = 0; i < 100; i++) {
char buf[256];
std::snprintf(buf, sizeof(buf), "data%03d.dat", i);
filename = buf;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment