cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
What does getline do?
What does getline do?
Aug 24, 2015 at 9:43am UTC
MikiBelavista
(5)
I am wrinting just part of the code
int main()
{
std::vector<std::vector<double>> v;
std::ifstream in( "pizd.dat" );
std::string record;
while ( std::getline( in, record ) )
So ifstream reads from the file the whole content.What is getline doing?
Aug 24, 2015 at 10:41am UTC
LB
(13399)
std::ifstream
is a stream. Nothing is read from the file unless you use the stream's input methods. One of those methods is calling
std::getline
on the stream.
Aug 24, 2015 at 11:03am UTC
keskiverto
(10402)
The description of std::getline is in the reference documentation:
http://www.cplusplus.com/reference/string/string/getline/
http://en.cppreference.com/w/cpp/string/basic_string/getline
Topic archived. No new replies allowed.