C++

Считывание строк из файла

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

using namespace std;

int main () {
	setlocale(0, "");
	string line;
	ifstream myfile ("ab.txt");
	if (myfile.is_open())
	{
		while (myfile.good() )
		{
			getline (myfile,line);
			cout << line << endl;
		}
		myfile.close ();
	}
	
	else cout << "Unable to open this shit";
	
	system("pause");
	return 0;
}
Добавлено: 14 Апреля 2014 01:00:51 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...