#include <locale.h>
/******宏定义*****/
#define CREATE_DEBUG_CONSOLE /
FILE* fpDebugOut = NULL; /
FILE* fpDebugIn = NULL; /
FILE* fpDebugErr = NULL; /
if( !AllocConsole() ) /
MessageBox(_T("控制台生成失败。"), NULL, 0); /
SetConsoleTitle(_T("Debug Window")); /
_tfreopen_s(&fpDebugOut, _T("CONOUT$"),_T("w"), stdout); /
_tfreopen_s(&fpDebugIn, _T("CONIN$"), _T("r"), stdin); /
_tfreopen_s(&fpDebugErr, _T("CONOUT$"),_T("w"), stderr); /
_tsetlocale(LC_ALL, _T("chs"));
#define RELEASE_DEBUG_CONSOLE /
fclose(fpDebugOut); /
fclose(fpDebugIn); /
fclose(fpDebugErr); /
FreeConsole();
/*****使用*****/
CREATE_DEBUG_CONSOLE
///*AllocConsole();
DWORD cCharsWritten = 0;
char s[] = "This is a