How can I see cout output in a non-console application?

后端 未结 8 2159
醉话见心
醉话见心 2021-02-06 22:10

It seems rather tedious to output to debug window. Where can I find cout output if I am writing a non-console information ?

Like:

double          


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-06 22:43

    Instead of using cout, create a log file and write anything you want into it.

    Edit: Use this simple code for writing to a log file.

    ofstream log;
    log.open ("log.txt");
    log << "Writing this to a file.\n";
    log.close();
    

提交回复
热议问题