C++ファイル操作の----テキスト中のデータを行ごとに読み取る


ifstreamにはgetline()関数が行単位で読み込まれています
ただし、この関数はstringタイプをサポートしていません.
getline(char *p,int); これはchar[]でバッファを作らなければなりません.
コンソールプログラムを勉強する時、使ったことがあります
string line;
cin >>line;
もう1つの方法はstd::getline(cin,line);
ifstreamではサブメソッドも使用できます
#include "stdafx.h"
#include 
#include 
#include 
using namespace std;
int main(int argc,char **argv){
    ifstream out;
    string str = "d:\\text.txt";
    out.open(str.c_str(), ios::in);
    string line;
    while(!out.eof()){
        std::getline(out,line);
        cout <