我的CP导师建议我使用ios_base :: sync_with_stdio(0);,因为它可以提高程序执行速度。在观看YouTube上的一些视频时,我也看到了ios :: sync_with_stdio(0);。
那么,添加或删除 _base 会有什么区别?
哪个更好,ios_base :: sync_with_stdio(0);还是ios :: sync_with_stdio(0);?
请解释一下。提前感谢您。
我的CP导师建议我使用ios_base :: sync_with_stdio(0);,因为它可以提高程序执行速度。在观看YouTube上的一些视频时,我也看到了ios :: sync_with_stdio(0);。
那么,添加或删除 _base 会有什么区别?
哪个更好,ios_base :: sync_with_stdio(0);还是ios :: sync_with_stdio(0);?
请解释一下。提前感谢您。
了解更多信息,请参见 cppreference io, cppreference static members, cppreference sync_with_stdio, cppreference derived classes ,我始终建议阅读一本好的 C++ 入门书。
ios_base::sync_with_stdio(0); 和 ios::sync_with_stdio(0); 哪个更好?
它们是相等的。
ios::sync_with_stdio
是从ios_base
继承的静态方法,它实际上是同样的东西。 - freakishsync_with_stdio
的技巧带来的速度更重要。 - Evg