Last active
August 29, 2015 14:12
-
-
Save duguying/a02e247ae397a66f4369 to your computer and use it in GitHub Desktop.
windows上实现打印调试函数dprinf
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 <stdio.h> | |
#include <stdlib.h> | |
FILE* dopen(const char* filename){ | |
return fopen(filename,"w"); | |
} | |
void dprintf(FILE* fd, const char *format,...){ | |
va_list args; | |
va_start(args,format); | |
vfprintf(fd,format,args); | |
va_end(args); | |
fflush(fd); | |
} | |
void dclose(FILE* fd){ | |
if (fd!=NULL){ | |
fclose(fd); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment