2009-04-01から1ヶ月間の記事一覧
とても簡単に書くと、次のプログラムを実行してCtrl-Dを入力した際に -1 とだけ出力されて欲しかったのです。 #include <iostream> int main() { while (1) { int c = std::cin.get(); std::cout << c << std::endl; } } ところが実際にはこうなります。 -1 -1 -1 ...(</iostream>…
とても簡単に書くと、次のプログラムを実行してCtrl-Dを入力した際に -1 とだけ出力されて欲しかったのです。 #include <iostream> int main() { while (1) { int c = std::cin.get(); std::cout << c << std::endl; } } ところが実際にはこうなります。 -1 -1 -1 ...(</iostream>…