“ios_base::sync_with_stdio(false);”语句的作用
c吧
全部回复
仅看楼主
level 8
ljsh642116479 楼主
学长说这个语句能使cin的输入更快 求大神告知这个语句的功能 谢谢
2013年10月10日 13点10分 1
level 14

static void sync_with_stdio();
Remarks
Synchronizes the C++ streams with the standard I/O system. The first time this function is called, it resets the predefined streams (
cin,
cout,
cerr,
clog) to use a
stdiobuf object rather than a
filebuf object. After that, you can mix I/O using these streams with I/O using
stdin,
stdout, and
stderr. Expect some performance decrease because there is buffering both in the stream class and in the standard I/O file system. After the call to
sync_with_stdio, the
ios::stdio bit is set for all affected predefined stream objects, and
cout is set to unit buffered mode.I
2013年10月10日 13点10分 2
谢谢了 只是[乖]英语……
2013年10月10日 14点10分
1