#include "stdafx.h"
#include <stdarg.h>
#include <iostream>
using namespace std;
static inline void hlogv(const char *format, va_list args)
{
char message[1024] = "";
int num = _vsprintf_p(message, 1024, format, args);
freopen("log.txt","w",stdout);
cout<<message<<endl;
freopen("CON", "w", stdout);
cout<<message<<endl;
}
void hlog(const char *format, ...)
{
va_list args;
va_start(args, format);
hlogv(format, args);
va_end(args);
}
int _tmain(int argc, _TCHAR* argv[])
{
int k = 4;
char s[] = "111";
hlog(".%s..%d..",s,k);
getchar();
return 0;
}