1.
No. h is now standard in C + +, with the aim of making C + + code available for porting and blending embedding without the extension. h restrictions,
Avoid additional processing and modification caused by. h is the use of C, but it is also supported in C + +.
Mainly in order to backward-compatible with C content, we usually try not to use this method
That's a good thing the friends upstairs have said.
However, # include <iostream> using namespace std;
or # include <iostream>
void Main ()
{//。。。
Std::cout (""); This output does not need to add std::, and directly write cout<< ""; it can be output, this I have tried, certainly to
}
2.
Iostream is now a standard in C + +, designed to make C + + code available for porting and blending without the extension. h restrictions,
Avoid additional processing and modification due to. h. Iostream contains the same basic functionality as the corresponding old header file,
But the contents of the header file are in the namespace Std.
(in the process of normalization, the details of some parts of the library have been modified, so the old header files and the entities in the new header file do not necessarily correspond exactly.) )
In general, this header file should be used, while the iostream.h is old-fashioned and may be eliminated later.
Technically, there is no such thing as <iostream.h>-the standardization committee replaced it with <iostream> when simplifying the non-C standard header file.
The reasons for their doing so are explained in clause 49. It is also important to know that if the compiler supports both <iostream> and <IOSTREAM.H>
The use of the file name will be very subtle. For example, if you are using # include <IOSTREAM>
Get the elements of the iostream library placed under the namespace STD (see clause 28), if you use # include <iostream.h>
The same elements that are placed in the global space are obtained. Getting elements in the global space can cause name collisions,
The design of the namespace is designed to avoid this name conflict. Also, when typing <iostream> less than <iostream.h> two words,
That's why a lot of people use it. :)·
Old C + + header filenames such as <iostream.h> will continue to be supported, although they are not in the official standard.
The contents of these header files are not in the namespace Std.
· The new C + + header file, such as <iostream> contains the same basic functionality as the corresponding old header file, but the contents of the header file are in the namespace Std.
(in the process of normalization, the details of some parts of the library have been modified, so the old header files and the entities in the new header file do not necessarily correspond exactly.) )