|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Permutations of a given string
Fri, 04 Jul 2008 12:37:12 -0700, Keith Thompson wrote:
Which actually raises a nearly interesting issue. C99 7.19.2p2 says: > A text stream is an ordered sequence of characters composed into _lines_, each line consisting of zero or more characters plus a terminating new-line character. Whether the last line requires a terminating new-line character is implementation-defined. > It's not clear from this wording whether an empty stream, consisting of zero lines, is valid. I have no doubt that it was intended to be the case; this is merely an issue about the wording in the standard. Your inference that an empty stream contains zero lines is only valid on implementations that define a line as requiring a newline character. Under implementations which define the final newline as optional or forbidden, the empty (zero-character) stream may contain 1 line. In any case if you are going to be picky over an entirely academic point, the standard you quote above says "lines" not "line or lines", so one could argue that a one-line stream was invalid. Even discussing it would be a bit sad though viza |
![]() |
| Viewing: Web Development Archives > FAQs > C/C++ > Permutations of a given string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|