Stream (Streams)

Only when the log flow.

Definition: flow is printf () and scanf () alternative.

Advantages: With the flow when, do not care about the type of the object in the output, and not worry about the format string argument list does not match (although printf in gcc this problem does not exist), open, close the corresponding file, stream may automatic configuration, destructors.

Disadvantages: stream such that the pread () functions is difficult to perform a function, without the use of printf functions but the use of such flow is difficult to form (particularly the format string is used %.*s), the flow does not support the string operator re sequencer (% 1s), and this is useful for internationalization.

Conclusion: Do not use streams, unless it is the log interfaces need to use printf instead of like.

Guess you like

Origin blog.csdn.net/weixin_34082789/article/details/91030163
Recommended