In short,<stdio.h> This is a C language header file, in use, need to be very clear about the type of variables to be manipulated, this will undoubtedly add a lot of risk, because at the outset, it may be defined by the int type, but later requirements change or abnormal data in the incoming, This data may become double type, then also need to be in all the printing of this variable, output, the use of the place to do a thorough troubleshooting, read these articles are obvious, but the article is more interested in the later words. Because this is not very much in the usual place.
" first, some iostream operations are less efficient than the corresponding C stream , because iostream is actually overloaded with operator<< and operator>>, Supposedly, most should be less efficient than C stream, and there are no instances higher than C stream, and this part continues to focus
" second, in the process of standardization, the iostream library has made a lot of changes at the bottom, so for those applications that require maximum portability, you will find that different vendors have different standards of compliance," the main point is to say that iostream may have a lot of risks in terms of porting, Because different platforms have different standards, in fact, C Stream for developers, it is not really used, for now C++,c#,java actually have a lot of iostream flow processing operations, for developers, can be very convenient to use, Can reduce the amount and complexity of code development, but all things have a good side and bad side. In the enjoyment of convenient and rapid development, the cost is the cross-platform transplant, the pain of compatibility. Of course, if the software currently being developed does not need to consider cross-platform, this item can be ignored. However, with the diversification of the current platform, Windows operating system is not unique, many companies develop the same software, to do Windows version, Linux version, mobile phone has Apple system, Android system, Windows system, for such a wide range of systems, in order to give themselves effort, It's better to think about these issues at the outset.
"Thirdly, the class of the iostream library has constructors, and the function in <stdio.h> does not, and in some cases, when it comes to the initialization order of static objects, it is simpler and more practical to use standard C libraries when it is possible to confirm that there is no hidden danger ."
About "Static object initialization order", Baidu a bit, found an article written well: (http://blog.csdn.net/leeyu35/article/details/7755304) but very curious, why static initialization sequence will bring hidden trouble, Because iostream has constructors, there is the problem of initializing static functions so that static variables are automatically paid, which can result in an unstable type. There is also an explanation:
The iostream constructor has some static objects. For example: Static CString str, if the development can confirm that static initialization will not have an impact, you can use the iostream, or use C stream to compare insurance.
Article 2: Try to use <iostream> without <stdio.h> [Effective C + + learning notes]