The difference between Iostream and Iostream.h

xiaoxiao2021-03-19  225

Key words: and

When you write the program, use or ?

Do you know what is the difference? Still think they are just the same?

Let me listen to me to blow you (the text is purely personal remarks, do not involve national secrets, please feel free to read, if you reprint, please indicate the author ^ - ^)

--- Majianan

In fact, there is no this --- Standardization Committee replaces it with when simplifying non-C standard header files. However, there is no use of , and many compilers support and , resulting in the current situation, the boss (standardization committee) does have a hard work.

In this year, when the Standardization Committee opened its new standard library, it encountered problems. In order to avoid conflicts of class names and function names, the namespace STD is introduced. However, countless existing C code relies on features in the multi-year counterfeit library, for example, the functionality in and . Existing software does not have a corresponding design or upgrade for the use of namespaces. If you pack the standard library with STD, the existing code cannot be used, the younger brother under the hand will not agree.

In order to pull the hearts, the Standards Committee attracted more people to build new headers named for the part of the standard library that packaged STD. Remove the present C header file name. Therefore, there are many twins such as and . For the C header file, use the same method but to add a C before each name, so C becomes .

The old C header file is the official explicitly opposed, but the old C header file is not (to maintain compatibility to C). In fact, compiler manufacturers will not stop providing support for customer existing software, so the old C header files will be awkward during the expected future.

If you can understand the use of the character's serial file, you will have a non-three, and others will be almost used.

is the old C header file, corresponding is based on Char *-based string processing function; is a C header file packaged with STD, corresponding is a new Strng class; is the old The STD version of the C header file.

Running is far away, the words come forward. If your compiler supports and , use #include , get the element of the iostream library placed under the namespace STD; if you use #include It is obtained to be placed in the same element of the global space. Acquiring elements in global space can lead to name conflicts, while the original intention of design name space is used to avoid this conflict in this name. Also, when typing, is less than less, so I will use ^ - ^

Sleepy, sleep.

Ma Jianan 2005-12-26 midnight

转载请注明原文地址:https://www.9cbs.com/read-130200.html

New Post(0)