1.4 iostream与iostream.h的区别

如果用iostream则需要加命名空间;

如果用iostream.h则不需要加命名空间;

示例:

#include<iostream>
using namespace std;
int main(){
    cout << "Hello World!";
    return 0;
}
#include<iostream.h>
int main(){
    cout << "Hello World!";
    return 0;
}

 

posted @ 2015-05-14 12:55  cppstudy  阅读(117)  评论(0编辑  收藏  举报