stdio performance in tango, stdlib, and perl

Roberto Mariottini rmariottini at mail.com
Thu Mar 22 01:14:29 PDT 2007


Andrei Alexandrescu (See Website For Email) wrote:
[...]
> 
> #include <string>
> #include <iostream>
> 
> int main() {
>   std::string s;
>   while (getline(std::cin, s)) {
>     std::cout << s << '\n';
>   }
> }

The portable way to write a newline in C++ is to use the 'endl'
modifier.
Your program is not portable, on Windows it will generate Unix text files.

Ciao



More information about the Digitalmars-d mailing list