AllocConsole() not displaying cout

前端 未结 3 727
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 23:07

I have a DLL where I use AllocConsole() and cout to display data for debugging purposes.
It used to work fine but since I updated my compiler (Visual Studio 2012) to the

3条回答
  •  [愿得一人]
    2020-12-02 23:38

    I vaguely recall that you might need to redirect the stdout to the console. I might be wrong though (since you had your code working earlier):

    AllocConsole();
    freopen("CONOUT$", "w", stdout);
    std::cout << "This works" << std::endl;
    

提交回复
热议问题