this only shows one string of the file, what should i do to show the entire text ont the file?Code:ifstream a_file( "Data.1" ); a_file>> x; cout<< x <<"\n";
This is a discussion on help me I/O within the C++ Programming forums, part of the General Programming Boards category; Code: ifstream a_file( "Data.1" ); a_file>> x; cout<< x <<"\n"; this only shows one string of the file, what should ...
this only shows one string of the file, what should i do to show the entire text ont the file?Code:ifstream a_file( "Data.1" ); a_file>> x; cout<< x <<"\n";
use getline()
Code:std::string line; getline(a_file,line); cout << line << endl;