Advertisement
Lukasz_Miskiewicz

operacje na plikach zad 7

May 24th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <fstream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     ofstream plik("plik.txt");
  10.     plik<<"Lukasz"<<endl;
  11.     plik<<"Miskiewicz"<<endl;
  12.     plik<<"18"<<endl;
  13.     string odczyt;
  14.     ifstream odczyt_pliku ("plik.txt");
  15.     odczyt_pliku.seekg(6,ios::beg);
  16.     while(getline(odczyt_pliku,odczyt))
  17.     {
  18.          cout <<odczyt<<endl;
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement