stream 프로그램과 소스 사이의 흐름 ex) 키보드의 input stream→ 프로그램 ex) 프로그램의 output stream → 디스플레이
buffer 입력과 출력을 위한 임시 저장 공간 큰 데이터를 다룰 때 좋다.
<ios> 상속 클래스들:
cin, cout
flushing buffer <ostream>
formatting
manipulators

Stream States
while(cin>>input) 가능한 이유: ()오버로드 되어있음; good()반환함
File stream
<ifstream> ifstream fin; fin.open(”dir”,[ios_base::in]);
fin.is_open() fin.clear(); //stream state bits 초기화 fin.close();
<ofstream> ofstream fout; fout.open(”dir”, [ios_base::out]);
fout<<”hello”; fin>>var; << , >> 오버로드 되어 있음!
Binary Files 0과 1로 전부 저장 ios_base::binary로 열기 fin.read((char*)&p1, sizeof(p1)); fout.write((char*)&p1, sizeof(p1));
Random Access
Incore formatting in-core: 내부에서 stream은 외부와 상호작용하지만, 여기서는 메모리 내에서 흐른다. 문법은 동일함