0

Possible Duplicate:
c++ console in a non-console application project

I am debugging windows program which started with winmain. There are smome printf inside, I am wondering if I can view the printf output somewhere? Do I need some special tools?

Community
  • 1
  • 1
Adam Lee
  • 24,710
  • 51
  • 156
  • 236

2 Answers2

0

Assuming you're using VC++ you can use OutputDebugString to display output in the IDE.

something like:

wchar_t buffer[512]
wsprintf(buffer, L"Value is %d\n", value);
OutputDebugString(buffer);
James
  • 9,064
  • 3
  • 31
  • 49
0

Try this:

AllocConsole();
freopen("CONOUT$", "wb", stdout);
// your printf()

fclose(stdout);
FreeConsole();
A_nto2
  • 1,106
  • 7
  • 16