Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <io.h>
- #include <string.h>
- #include <vector>
- #include <string>
- void Usage(const char* msg = NULL)
- {
- if (msg)
- printf("%sn", msg);
- printf("Usage: coderep (prefix) (infile) (listfile) (outfile)n");
- }
- char* OpenAndReadFile(const char* filename)
- {
- FILE* fp = fopen(filename, "rb");
- if (!fp)
- return NULL;
- fseek(fp, 0, SEEK_END);
- int size = (int)ftell(fp);
- fseek(fp, 0, SEEK_SET);
- char* buf = new char[size + 2];
- fread(buf, 1, size, fp);
- buf[size] = '