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
  • 23,314
  • 47
  • 144
  • 221

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
  • 8,897
  • 2
  • 28
  • 47
0

Try this:

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

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