Created
August 12, 2013 07:14
-
-
Save chengluyu/6208769 to your computer and use it in GitHub Desktop.
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
#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", "r"); | |
char str[100] = {0}; | |
file_scanf(f, "%s", str); | |
file_close(f); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment