C++ cout printing slowly

前端 未结 8 2090
情深已故
情深已故 2020-11-30 14:23

I noticed if I print out a long string(char*) using cout it seems to print 1 character at a time to the screen in Windows 7, Vista, and Linux(using putty) using Visual C++ 2

8条回答
  •  醉酒成梦
    2020-11-30 15:00

    Here is hax that should make c++ streams as fast as c printf. I never tested it but I believe it works.

    ios_base::sync_with_stdio(0);
    

提交回复
热议问题