Original Post
In this Win32 app, how would I get the standard C++ input/output stream operators (cin & cout) to work with an allocated console?
I already know about WriteConsole(), but it would be nice to just use cout. Is this possible?
Thanks in advance,
-Mike
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
AllocConsole();
cout << "hello"; //doesn''t work
FreeConsole();
MessageBox(0,"Program Complete", "", 0);
return 0;
}