2013년 4월 24일 수요일

[ C++ ] 파일 읽기 샘플


파일읽기 간단 샘플


#include <fstream>
#include <string>
#include <iostream>

using namespace std;

int main( )
{
  ifstream ifs("data.txt");
  string buf;

  while(ifs && getline(ifs, buf)) {
    cout << buf << endl;
  }

  return 0;
}

댓글 없음:

댓글 쓰기