TITLE: string extraction (Newsgroups: comp.std.c++) PROBLEM: mcsweeny@freenet.calgary.ab.ca (M/K McSweeny) Looking at the April 95 working paper, I cannot determine the expected behaviour for code like: [ String x; for (int i = 0; i< ...; i++) { cin >> x; ...do something with x } ] That is, does 'cin >> x' reset the string prior to reading it? The Plum-Hall libraries did reset the string, some newer environments are not. Now assume that the words in the input stream are separated by two spaces instead of one. Should a null word be read between each pair of spaces or should all leading whitespace be gobbled up prior to reading each word? RESPONSE: clamage@Eng.Sun.COM (Steve Clamage), 11 June 96 According to the latest working paper, the string extraction operator appends characters to the string. No mention is made of resetting the string, and indeed that would seem like peculiar behavior to me. Initial whitespace skipping may be turned on or off. It is supposed to be on by default. In that case, it doesn't matter how much whitespace separates fields. All leading whitespace is skipped, and data is read up to the next whitespace or until some other termination condition is met. If whitespace skipping is off, no whitespace will ever be read. Upon encountering the first whitespace, no more input should occur by using the string extractor. You would have to use unformatted input operations to read or otherwise scan off the whitespace.