std::vector
12345678
std:ifstream inFile{ "text.txt" }; if ( inFile.is_open( ) ) { std::stringstream buffer; buffer << inFile.rdbuf( ); std::cout << buffer.str( ) << "\n"; }
12345
std::string AllTextInFile, temp; std::ifstream File("1.txt"); getline(File,temp); AllTextInFile=temp; while(getline(File,temp))AllTextInFile+="\n"+temp;