Quirinus

File Read

Oct 19th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <fstream> //dodati na vrh koda za program
  2.  
  3. string polje[5]; //stvara polje koje sadrži tekst (string)
  4.  
  5. ifstream file("brojevi.txt"); //otvara datoteku „brojevi.txt” za čitanje
  6.  
  7. getline(file, polje[i]); //sprema jedan red datoteke u polje[i]
  8.  
  9. file.close(); //zatvara datoteku
Advertisement
Add Comment
Please, Sign In to add comment