Programming Language/c++언어

비주얼스튜디오 iostream.h 오류시

푸른너구리 2010. 1. 17. 20:55

비주얼스튜디오 2008부터 c++에서는 더이상 iostream.h 지원 안하고 iostream을 지원한다..(c언어 헤더는 그대로 지원)

2008이전 버전 사용시 가능
#include <iostream.h>
cout
cin
endl

2008버전부터는 이렇게 써야한다..
#include <iostream>
std::cout
std::cin
std::endl

std::를 써줘야 하는 귀찮음이 있는데   처음에
#include <iostream>
using std::cout;
using std::cin;
using std::end;
로 해주고 쓰면 std:: 안쓰고 사용이 가능
아니면 한번에
using namespace std;  하면 따로 따로 입력할 필요없음..