Skip to content

Instantly share code, notes, and snippets.

@chengluyu
Last active December 20, 2015 22:09
Show Gist options
  • Save chengluyu/6202958 to your computer and use it in GitHub Desktop.
Save chengluyu/6202958 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstdio>
using namespace std;
#define CONCAT(a, b) a##b
#define file_type CONCAT(FI, LE)
#define file_open CONCAT(fo, pen)
#define file_scanf CONCAT(fs, canf)
#define file_printf CONCAT(fp, rintf)
#define file_close CONCAT(fc, lose)
int main(int argc, const char *argv[]) {
file_type * f = file_open("use_macro_to_create_file", "w");
file_printf(f, "https://gist.github.com/chengluyu/6202958");
file_close(f);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment