How to read getline with a line feed ... but you have to add \n yourself.
#include <iostream> #include <fstream> #include <string> void FuncReadFile(char* path, std::string &text) { //Переменная для чтения по указанному пути std::ifstream FileInput(path); std::string str; while (!FileInput.eof()) { getline(FileInput, str); text = text+ str + "\n"; } } int main() { setlocale(LC_ALL, "RUS"); std::string text; char* path = "input.txt"; FuncReadFile(path, text); std::cout << text<<std::endl; std::cout << "END" << std::endl; system("pause"); }