The function getline() is used with input streams, and reads num bytes from the stream before placing them in buffer. If EOF is encountered, read() stops, leaving however many bytes it put into buffer.
Syntax:istream &getline( char *buffer, streamsize num );
Example:struct {
int height;
int width;
} rectangle;
input_file.getline( (char *)(&rectangle), sizeof(rectangle) );
if( input_file.bad() ) {
cerr << "error reading data" << endl;
exit( 0 );
}
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 549 / 159177053. Delta: 0.00259 с