Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Файловый поток ofstream не сразу выводит в файл, а буферизует выведенные в него данные
- // cout и cerr ведут себя точно так же
- // манипулятор endl не только выводит перевод строки, но и сбрасывает буфер потока в файл
- #include <iostream>
- #include <vector>
- #include <fstream>
- using namespace std;
- int main()
- {
- ofstream out("output.txt");
- /*for (int i = 0; i < 25; ++i)
- {
- out << "London is the capital of GreatBritain. "
- << "I am travellong down the river"
- << '\n';
- }*/
- for (int i = 0; i < 25; ++i)
- {
- out << "London is the capital of GreatBritain. "
- << "I am travellong down the river"
- << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement