I'm not sure what you mean here. getline() does not strip whitespace: each returned line ends in a \n, unless it's the last line of the file and it doesn't have a trailing newline.