The difference between iostream and iostream.h

Source: Internet
Author: User
#include <iostream> //标准输入输出流#include <iostream.h> //非标准输入输出流

In C + +, in order to avoid name definition conflicts, the namespace definition (namespace) is introduced, and when used in code, <iostream.h> it inherits the standard library file of C and has no namespace, so it is not (and cannot) use std::cout<<x; .
<iostream>the input and output needs to be referenced when the code is used std::cout<<x; .

There are ". h" is the non-C + + standard, is the standard library file C, no ". h", the use of command space , is the C + + standard library file.

The same is true of the following:
<string.h>is the old C header file, corresponding to a char-based string processing function;
<string>is the C + + header file that is packaged with STD, corresponding to the new string class;
<cstring>is the STD version of the old C header file, and char-based
string processing functions.

The difference between iostream and iostream.h

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.