Last active
December 20, 2015 22:09
-
-
Save chengluyu/6202958 to your computer and use it in GitHub Desktop.
This file contains 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
#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