Advertisement
JakubJaneczek

Zadanie 7

May 31st, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cstdlib>
  4. #include <fstream>
  5.  
  6. using namespace std;
  7.  
  8. string o;
  9.  
  10. int main()
  11. {
  12.     ofstream zapis_do_pliku("plik.txt");
  13.     zapis_do_pliku<<"Jakub"<<endl;
  14.     zapis_do_pliku<<"Janeczek"<<endl;
  15.     zapis_do_pliku<<"19"<<endl;
  16.  
  17.     ifstream odczyt_z_pliku ("plik.txt");
  18.  
  19.  
  20.     odczyt_z_pliku.seekg(5,ios::beg);
  21.  
  22.     while(getline(odczyt_z_pliku,o))
  23.     {
  24.          cout <<o<<endl;
  25.     }
  26.  
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement