C++ cout printing slowly

前端 未结 8 2048
情深已故
情深已故 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 14:43

    Try using ios::sync_with_stdio(false);. Mention it before using std::cin/cout. It doesn't mix stdio or iostream but it synchronizes iostream standard streams with their corresponding standard c streams. for example - std::cin/wcin of iostream is synchronized with stdin of c stream

提交回复
热议问题