Advertisement
Dawid_PAr

plik1

Aug 7th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. void plik(string adres)
  8. {
  9. ifstream odczyt;
  10. string z;
  11. odczyt.open(adres.c_str());
  12. while(!odczyt.eof())
  13. {
  14. getline(odczyt, z);
  15. cout << z << endl;
  16. }
  17. odczyt.close();
  18.  
  19. }
  20. int main()
  21. {
  22.  
  23.  
  24. string a = "plik1.txt";
  25. plik(a);
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement